No internet connection
  1. Home
  2. How to

insert active/inactive for all

By dex green @dex_green
    2021-02-17 14:36:05.085Z

    greetings friends

    I'm looking to tweek Chris Shaw's insert active/inactive macro in a way that will affect all plug in slots on the track

    Has this been done already and I'm missig it somewhere on the forum?

    thanks!

    -dex

    • 9 replies
    1. In reply todex_green:

      Hey Dex,

      Just to clarify, are you referring to the Insert & Send Cycle / Toggle / Bypass package?
      Also what functions do you want to affect all plugin slots because there are a few options available:

      Bypass On/Off: This would bypass all plugins. If there are five plugins and two of them are already in bypass then the remaining inserts will also be bypassed. The challenge here is that if you run this script again then ALL of the plugins will be un-bypassed.

      Toggle Bypass: This would toggle the bypass state of each plugin. As above, if two plugins are already bypassed then those two would be un-bypassed and the others will be bypassed. Running the script a second time would invert the bypass state of all plugins. Not too useful.

      Toggle Inactive / Active: This would probably be the better but not 'perfect' option. This would make all of the plugins inactive. The benefit here is that the bypass state of the plugins isn't changed so when they are made active again the bypass states of all the plugins. The tradeoff here is that changing the active / inactive state of a plugin is slower than bypassing.

      Thoughts?

      1. Ddex green @dex_green
          2021-02-23 18:35:47.296Z

          Yeah man,

          The idea would be to make the plugs on the master bus inacvtive (toggle/inactive)..... for when you gotta throw that last tambourine overdub on a final mix and you are on an apollo, ha

          1. Chris Shaw @Chris_Shaw2021-02-23 21:52:29.800Z2021-09-14 07:43:46.667Z

            This Should do it. It will toggle the active state on all plugins on selected the selected track(s).

            
            sf.ui.proTools.appActivate();
            sf.ui.proTools.mainWindow.invalidate();
            
            // Get selected track names
            var selectedTracksNames = sf.ui.proTools.selectedTrackNames;
            
            // Loop trough each selected track
            for (var i = 0; i < selectedTracksNames.length; i++) {
                sf.ui.proTools.trackSelectByName({
                    names: [selectedTracksNames[i]],
                });
                // Toggle sends active state
                for (var x = 0; x < 10; x++) {
                    if (sf.ui.proTools.selectedTrack.insertButtons[x].value.invalidate().value != "unassigned") {
                        sf.ui.proTools.selectedTrack.trackInsertToggleActive({
                            insertNumber: x + 1,
            
                        });
                    } else {
                        continue;
                    }
                }
            }
            // reselect original tracks
            sf.ui.proTools.trackSelectByName({
                names: selectedTracksNames,
            });
            

            Keep in mind, if one of the plugins is already inactive it will be made active. But it should work otherwise.

            1. Ddex green @dex_green
                2021-02-24 15:11:31.532Z

                You rule Chris!

                thank you kind sir

                1. In reply toChris_Shaw:
                  AArmand Hirsch @Armand_Hirsch
                    2021-10-26 20:05:38.565Z

                    Is there a simple mod to this that will select track by specified name as opposed to selected track? Like for this master bus application, without having to scroll over to that track within the session. I attempted to tweak the code here for a while but came up empty. Thanks so much!!!

                    1. Chris Shaw @Chris_Shaw2021-10-27 00:29:30.305Z2021-10-27 15:34:31.767Z

                      This should do it.
                      Just replace the const choiceFader name/string with your desired track.
                      I added a function to scroll to your choice track and then back to the first selected track in the session before triggering the script.

                      sf.ui.proTools.appActivate();
                      sf.ui.proTools.mainWindow.invalidate();
                      
                      const choiceFader = ["---Master---"];
                      
                      function scrollToTrackNamed(trackList) {
                      
                          // Open scroll to track dialog and enter track name
                          sf.ui.proTools.menuClick({ menuPath: ['Track', 'Scroll to Track...'] });
                          var confirmationDialogWin = sf.ui.proTools.confirmationDialog;
                      
                          confirmationDialogWin.elementWaitFor();
                      
                          confirmationDialogWin.textFields.first.elementSetTextFieldWithAreaValue({ value: trackList[0] });
                      
                          confirmationDialogWin.buttons.whoseTitle.is('OK').first.elementClick();
                      
                          confirmationDialogWin.elementWaitFor({ waitType: 'Disappear' });
                      
                          //Re-select originally selected tracks
                          sf.ui.proTools.trackSelectByName({ names: trackList })
                      };
                      
                      
                      // Get selected track names to reselect later
                      
                      var origSelectedTracks = sf.ui.proTools.selectedTrackNames;
                      
                      //scroll to choice fader
                      scrollToTrackNamed(choiceFader);
                      
                      // Toggle inserts active state
                      for (var x = 0; x < 10; x++) {
                          if (sf.ui.proTools.selectedTrack.insertButtons[x].value.invalidate().value != "unassigned") {
                              sf.ui.proTools.selectedTrack.trackInsertToggleActive({
                                  insertNumber: x + 1,
                      
                              });
                          }
                      };
                      
                      // If tracks were selected at start of script, reselect them
                      if (origSelectedTracks.length >= 1) {
                          // reselect original tracks
                          sf.ui.proTools.trackSelectByName({
                              names: origSelectedTracks,
                          });
                      
                          // scroll to first selected track
                          scrollToTrackNamed(origSelectedTracks)
                      };
                      
                    2. In reply toChris_Shaw:
                      Ben Rubin @Ben_Rubin
                        2025-03-24 19:34:00.395Z

                        Hey @Chris_Shaw, thanks for this great script. Wondering if its possible to add some error catching so if the script catches a plugin that is no longer loaded into PT, it will keep going. Telling me the name of the missing plugin would be a nice bonus. Thanks much.

                  • Z
                    In reply todex_green:
                    Zach McNees @Zach_McNees
                      2023-03-23 14:28:22.784Z

                      Hey @Chris_Shaw ! Looking for a way to just deactivate the Insight 2 level meter plugin which is the final insert on my Master Fader, in slot B always. Basically just a one click to deactivate, and reactivate maybe as a second script.