No internet connection
  1. Home
  2. Macro and Script Help

update MEMORY LOCATION

By Mix 3 Mix 3 @Mix_3_Mix_3
    2025-02-02 17:47:24.478Z

    Title

    update MEMORY LOCATION

    What do you expect to happen when you run the script/macro?

    I have a memory location, always #1, to keep track of where I am in the mix (audio post for films). I want a script that updates its location.

    So I'm somewhere farther along than where it's stored, I right click on the memloc, and since it's checked to UPDATE POSITION I just need to ENTER.

    This script I found does that except ENTER, how do I do that ??

    Are you seeing an error?

    What happens when you run this script?

    it updates the location but I need to hit ENTER on the Memory Location window that pops up, surely it can also do that.

    HOWEVER, I found this script because there doesn't seem to be a RIGHT CLICK macro in the MEMORY LOCATIONS Macros in Soundflow (I'm not a programmer so this is akin to gibberish to me :-))

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    4

    Details

    {
        "inputExpected": "I have a memory location, always #1, to keep track of where I am in the mix (audio post for films). I want a script that updates its location. \n\nSo I'm somewhere farther along than where it's stored, I right click on the memloc, and since it's checked to UPDATE POSITION I just need to ENTER.\n\nThis script I found does that except ENTER,  how do I do that ??",
        "inputIsError": false,
        "inputWhatHappens": "it updates the location but I need to hit ENTER on the Memory Location window that pops up, surely it can also do that.\n\nHOWEVER, I found this script because there doesn't seem to be a RIGHT CLICK macro in the MEMORY LOCATIONS Macros in Soundflow (I'm not a programmer so this is akin to gibberish to me :-))",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 4,
        "inputTitle": "update MEMORY LOCATION"
    }

    Source

    function editMemLoc(number) {
        var numberStr = (number + '');
        var keys = [
            `numpad comma`,
            ...(Array.from(numberStr).map(c => `numpad ${c}`)),
            `numpad enter`,
        ].join(', ');
        //log(keys);
        sf.ui.proTools.appActivateMainWindow();
        sf.keyboard.press({ keys: keys, });
    }
    
    editMemLoc(1);
    

    Links

    User UID: 4yUv4NOIqqcHms9fAItO3Sflf302

    Feedback Key: sffeedback:4yUv4NOIqqcHms9fAItO3Sflf302:-OI6lY_abSPkkR-A6i4X

    Feedback ZIP: mOwo10QVyD7X7fKnRxa3WvWcSEzFI5eFvT9IptOAvIbG2M1m80T9hkjO6GinNdLUEJbDXwmnR6hQl+VoG9lyE8j9pIcJs/W3f2E1p2azHKRDuct3msutRSv9wYhN3sdmwxfTOHXXtA9U+s4t1d09y9aqEfRajaprvsT4p8cJ2+OzmCmL+jCnhDw/azbVJyZ+IvTQ/p1ThW/j2zTvGdZBR2DPByHqhc5BWUsmaCHV2QWRVSOPW/qQzagRaH5Dq4GrNPSswW4TYy4ui9FSOhAhRLCf/L43UNO+96jLaKflyVkzW/yU/5Zr0u48KNobvlp4C9hrxLC/pkkkV6dUp0F+e2ZTY8RCbTZS66+vftfH3pI=

    • 2 replies
    1. Hey @Mix_3_Mix_3, here's an updated version of the script you're working with. This should get you all the way through:

      function editMemLoc(number) {
          const editMemoryLocationWindow = sf.ui.proTools.newMemoryLocationDialog;
      
          const keys = [
              `numpad comma`,
              `numpad ${number}`,
              `numpad enter`,
          ].join(', ');
      
          sf.ui.proTools.appActivateMainWindow();
      
          sf.keyboard.press({ keys });
      
          editMemoryLocationWindow.elementWaitFor();
          editMemoryLocationWindow.checkBoxes.whoseTitle.is("Update Position").first
              .checkboxSet({ targetValue: "Enable" });
      
          editMemoryLocationWindow.buttons.whoseTitle.is("OK").first.elementClick();
          editMemoryLocationWindow.elementWaitFor({ waitType: "Disappear" });
      }
      
      editMemLoc(1);
      

      And here's another version that's more transparent:

      /** @param {{ number: number }} args */
      function updateMarkerPosition({ number }) {
          sf.app.proTools.memoryLocations.invalidate();
      
          const mainCounterValue = sf.ui.proTools.mainWindow.counterDisplay
              .textFields.whoseTitle.is("Main Counter").first.value.value;
      
          const memoryLocation = sf.app.proTools.memoryLocations.allItems
              .find(memLoc => memLoc.number === 1);
      
          sf.app.proTools.editMemoryLocation({
              name: memoryLocation.name,
              number: memoryLocation.number,
              startTime: mainCounterValue,
              comments: memoryLocation.comments
          });
      }
      
      updateMarkerPosition({ number: 1 });
      

      This one might have unforeseen consequences if the memory location is being used as something other than a marker (e.g. has properties selected in the Edit Memory Location window). Use whichever version performs best in your workflow.

      1. MMix 3 Mix 3 @Mix_3_Mix_3
          2025-02-02 19:09:38.136Z

          Thank You !!! brilliant...