No internet connection
  1. Home
  2. Support

Automation enable script not working

By Eli Crews @Eli_Crews
    2025-06-22 15:50:38.735Z

    Title

    Automation enable script not working

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

    Supposed to enable all automation parameters

    Are you seeing an error?

    Could not click automation button (line 29)

    What happens when you run this script?

    Just the error

    How were you running this script?

    I used a keyboard shortcut within the target app

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "Supposed to enable all automation parameters",
        "inputIsError": true,
        "inputError": "Could not click automation button (line 29)",
        "inputWhatHappens": "Just the error",
        "inputHowRun": {
            "key": "-Mpfwh4RkPLb2LPwjePT",
            "title": "I used a keyboard shortcut within the target app"
        },
        "inputImportance": 5,
        "inputTitle": "Automation enable script not working"
    }

    Source

    sf.ui.proTools.appActivateMainWindow();
    
    let autowin = sf.ui.proTools.automationWindow
    let plugin = autowin.enablePluginAutoButton
    let volume = autowin.enableVolumeAutoButton
    let sendVolume = autowin.enableSendVolumeAutoButton
    let pan = autowin.enablePanAutoButton
    let SendPan = autowin.enableSendPanAutoButton
    let mute = autowin.enableMuteAutoButton
    let sendMute = autowin.enableSendMuteAutoButton
    let objectBus = autowin.buttons.whoseDescription.is('Enable Object/Bus Toggle Automation')
    
    
    
    globalState.isEnabled = !globalState.isEnabled;
    
    // Toggle All Automation ON
    if (globalState.isEnabled) {
        // Open Automation Window
        sf.ui.proTools.menuClick({
            menuPath: ["Window", "Automation"],
            targetValue: "Enable"
        });
    
        autowin.elementWaitFor({
            waitType: "Appear",
        });
    
        plugin.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        volume.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        sendVolume.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        pan.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        SendPan.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        mute.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        sendMute.proToolsAutomationClickButton({
            targetValue: "Enable",
        });
    
        if (objectBus.first.value.invalidate().value !== "Selected")
            objectBus.first.checkboxSet({
                targetValue: "Enable",
            });
    
        sf.wait({
            intervalMs: 1000
        });
    
        // Close Automation Window
        sf.ui.proTools.menuClick({
            menuPath: ["Window", "Automation"],
            targetValue: "Disable"
        });
    
        autowin.elementWaitFor({
            waitType: "Disappear",
        });
    
    } else {
        // Toggle All Automation OFF
        sf.ui.proTools.menuClick({
            menuPath: ["Window", "Automation"],
            targetValue: "Enable"
        });
    
        autowin.elementWaitFor({
            waitType: "Appear",
        });
    
        plugin.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        volume.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        sendVolume.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        pan.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        SendPan.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        mute.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        sendMute.proToolsAutomationClickButton({
            targetValue: "Disable",
        });
    
        if (objectBus.first.value.invalidate().value == "Selected")
            objectBus.first.checkboxSet({
                targetValue: "Enable",
            });
    
        sf.wait({
            intervalMs: 1000
        });
    
        // Close Automation Window
        sf.ui.proTools.menuClick({
            menuPath: ["Window", "Automation"],
            targetValue: "Disable"
        });
    
        autowin.elementWaitFor({
            waitType: "Disappear",
        });
    }
    

    Links

    User UID: FBLa5v2xxqUfy8frXnCX930H3JC2

    Feedback Key: sffeedback:FBLa5v2xxqUfy8frXnCX930H3JC2:-OTNKPBqq6lIBatTcUTV

    Feedback ZIP: o2LPk/qM/XL/6zq0bhLcdx6NAUJkN7NT/4ZJ+W+w5llz0uojcp2MBzMUBKG3WANFBRWLO1ePJoysodzWNSi4ZHl1spM/ONr5lDIZXNDo3/3DGtorx2v+3YdLOJttgbarivtRuIynosPMp/nBseIL5NKkL298t9iSrtmLabzoKilcQAXbSEYwArUJXTlve1qE/Mk2tlrt3BsFLOQYLz2gNxbhR4V7rA/OwT2NcXReThfvdNaoX7tSHyB56m2NzA3fKaInReQ27NJwuIe9s9P1BDrxPcme/eN/Aq9GNNlIjgRUuJcJrbDjEudXcq3HuE8YoZbPoQ0NlFJfKh645rSomA==

    Solved in post #12, click to view
    • 13 replies
    1. Kitch Membery @Kitch2025-06-23 17:51:29.953Z

      Hi @Eli_Crews

      Can I get you to try swapping line 4 of your script to this...

      let plugin = autowin.buttons.whoseTitle.is("Enable Plugin Automation").first;
      

      At a glance, it looks like this is due to a change that was made in Pro Tools 2024.10, where all instances of the words "Plug-in" have been changed to "Plugin" across most (if not all) menus in Pro Tools. This also affects the titles and values of related UI Elements. I shall log this, as a proper fix will need to be made under the hood, but this should work for the time being.

      For more information on changes, please see the following link.
      Pro Tools Scripting: Changes and Known Issues

      I'm also seeing from your logs that you are currently on SoundFlow v5.10.3. Be sure to update to the latest version of SoundFlow from soundflow.org/account/install

      1. EEli Crews @Eli_Crews
          2025-06-23 19:55:39.266Z

          Ok, I updated to 5.10.6. I pasted what you suggested in for line 4, and it throws this error now:
          !! Command Error: Automate Everything script [user:ckxutogx50005r310sz5proau:cmc7u83g50001qq10wzyxpt48]:
          TypeError: Object has no method 'proToolsAutomationClickButton'
          (Automate Everything script line 29)

          1. Kitch Membery @Kitch2025-06-23 20:33:05.158Z

            Hi @Eli_Crews

            Thanks for updating and reporting back.

            Can you instead try replacing line 4 with this...

            let plugin = sf.ui.proTools.automationWindow.buttons.whoseTitle.is("Enable Plugin Automation").first;
            

            Let me know if that works.

            1. EEli Crews @Eli_Crews
                2025-06-23 20:39:43.829Z

                New error! :

                !! Command Error: Automate Everything script [user:ckxutogx50005r310sz5proau:cmc7u83g50001qq10wzyxpt48]:
                TypeError: Object has no method 'proToolsAutomationClickButton'
                (Automate Everything script line 87)

                1. EEli Crews @Eli_Crews
                    2025-06-23 20:40:35.732Z

                    Oh sorry, same error, just different line of the script

                    1. In reply toEli_Crews:
                      Kitch Membery @Kitch2025-06-23 20:41:59.451Z

                      Hi @Eli_Crews

                      It looks like I'll have to dig a bit deeper.

                      Out of interest, what is the Pro Tools version that you are using this on?

                      1. EEli Crews @Eli_Crews
                          2025-06-23 21:58:18.035Z

                          2025.6.0, but I 'll try your new script

                2. S
                  In reply toEli_Crews:
                  SoundFlow Bot @soundflowbot
                    2025-06-23 17:51:41.535Z

                    This issue is now tracked internally by SoundFlow as SF-2043

                    1. In reply toEli_Crews:
                      Kitch Membery @Kitch2025-06-23 21:12:40.595Z

                      Hi @Eli_Crews

                      Here's a refactored version that should work.

                      sf.ui.proTools.appActivateMainWindow();
                      
                      const automationWindow = sf.ui.proTools.automationWindow;
                      
                      if (!automationWindow.exists) {
                          sf.ui.proTools.menuClick({ menuPath: ["Window", "Automation"], targetValue: "Enable" });
                          automationWindow.elementWaitFor();
                      }
                      
                      const plugin = automationWindow.buttons.whoseTitle.is("Enable Plugin Automation").first;
                      const volume = automationWindow.enableVolumeAutoButton;
                      const sendVolume = automationWindow.enableSendVolumeAutoButton;
                      const pan = automationWindow.enablePanAutoButton;
                      const sendPan = automationWindow.enableSendPanAutoButton;
                      const mute = automationWindow.enableMuteAutoButton;
                      const sendMute = automationWindow.enableSendMuteAutoButton;
                      const objectBus = automationWindow.buttons.whoseDescription.is('Enable Object/Bus Toggle Automation').first;
                      
                      if (globalState.isEnabled) {
                          // Toggle All Automation ON
                      
                          if (plugin.value.invalidate().value !== "Selected")
                              plugin.elementClick();
                      
                          volume.proToolsAutomationClickButton({ targetValue: "Enable", });
                          sendVolume.proToolsAutomationClickButton({ targetValue: "Enable", });
                          pan.proToolsAutomationClickButton({ targetValue: "Enable", });
                          sendPan.proToolsAutomationClickButton({ targetValue: "Enable", });
                          mute.proToolsAutomationClickButton({ targetValue: "Enable", });
                          sendMute.proToolsAutomationClickButton({ targetValue: "Enable", });
                      
                          if (objectBus.value.value !== "Selected")
                              objectBus.elementClick();
                      
                      } else {
                          // Toggle All Automation OFF
                      
                          if (plugin.value.invalidate().value === "Selected")
                              plugin.elementClick();
                      
                          volume.proToolsAutomationClickButton({ targetValue: "Disable", });
                          sendVolume.proToolsAutomationClickButton({ targetValue: "Disable", });
                          pan.proToolsAutomationClickButton({ targetValue: "Disable", });
                          sendPan.proToolsAutomationClickButton({ targetValue: "Disable", });
                          mute.proToolsAutomationClickButton({ targetValue: "Disable", });
                          sendMute.proToolsAutomationClickButton({ targetValue: "Disable", });
                      
                          if (objectBus.value.invalidate().value === "Selected")
                              objectBus.elementClick();
                      }
                      
                      sf.wait({ intervalMs: 1000 });
                      
                      // Close Automation Window
                      sf.ui.proTools.menuClick({
                          menuPath: ["Window", "Automation"],
                          targetValue: "Disable"
                      });
                      
                      automationWindow.elementWaitFor({ waitType: "Disappear", });
                      
                      globalState.isEnabled = !globalState.isEnabled;
                      

                      Let me know if that works for you. :-)

                      1. EEli Crews @Eli_Crews
                          2025-06-23 22:01:46.997Z

                          Great, progress! That toggles, but I'd love to have one that just turns everything on. I'm often inheriting sessions where somebody turned just one or two of the parameters off, and I don't catch it. So I'm building this into my macro to conform pre-existing sessions to my default settings. Thanks!

                          1. Kitch Membery @Kitch2025-06-23 22:20:55.485Z

                            Hi @Eli_Crews

                            This will enable them all :-)

                            sf.ui.proTools.appActivateMainWindow();
                            
                            const automationWindow = sf.ui.proTools.automationWindow;
                            
                            if (!automationWindow.exists) {
                                sf.ui.proTools.menuClick({ menuPath: ["Window", "Automation"], targetValue: "Enable" });
                                automationWindow.elementWaitFor();
                            }
                            
                            const plugin = automationWindow.buttons.whoseTitle.is("Enable Plugin Automation").first;
                            const volume = automationWindow.enableVolumeAutoButton;
                            const sendVolume = automationWindow.enableSendVolumeAutoButton;
                            const pan = automationWindow.enablePanAutoButton;
                            const sendPan = automationWindow.enableSendPanAutoButton;
                            const mute = automationWindow.enableMuteAutoButton;
                            const sendMute = automationWindow.enableSendMuteAutoButton;
                            const objectBus = automationWindow.buttons.whoseDescription.is('Enable Object/Bus Toggle Automation').first;
                            
                            if (plugin.value.invalidate().value !== "Selected")
                                plugin.elementClick();
                            
                            volume.proToolsAutomationClickButton({ targetValue: "Enable", });
                            sendVolume.proToolsAutomationClickButton({ targetValue: "Enable", });
                            pan.proToolsAutomationClickButton({ targetValue: "Enable", });
                            sendPan.proToolsAutomationClickButton({ targetValue: "Enable", });
                            mute.proToolsAutomationClickButton({ targetValue: "Enable", });
                            sendMute.proToolsAutomationClickButton({ targetValue: "Enable", });
                            
                            if (objectBus.value.value !== "Selected")
                                objectBus.elementClick();
                            
                            // Close Automation Window
                            sf.ui.proTools.menuClick({
                                menuPath: ["Window", "Automation"],
                                targetValue: "Disable"
                            });
                            
                            automationWindow.elementWaitFor({ waitType: "Disappear", });
                            
                            ReplySolution
                            1. EEli Crews @Eli_Crews
                                2025-06-23 22:51:10.643Z

                                That works, thank you!

                                1. Kitch Membery @Kitch2025-06-23 23:03:14.313Z

                                  You're welcome, @Eli_Crews