No internet connection
  1. Home
  2. How to

Scan session and select all tracks with specific plugin(s)

By Tristan Hoogland @Tristan
    2022-11-14 21:24:46.551Z

    Hi

    I'm looking for a script that can scan the entire protools session and select all tracks containing a specific plugin. i.e. "Devil-Loc" - multiple would be ideal, but I think I can work that part out with wildcards. any pointers in the right direction? Thanks team!

    Solved in post #5, click to view
    • 13 replies
    1. Mitch Willard @Mitch_Willard
        2022-11-14 23:31:50.806Z

        Hey @Tristan_Hoogland ,

        Check out in the store the Scheps Track Selector, it'll do what you're asking plus more, super powerful.

        Mitch

        1. TTristan Hoogland @Tristan
            2022-11-14 23:35:38.064Z

            Hey Mitch! Thanks for the lead on that. Sorry I should have clarified while Andrew's track selector is amazing and I know that feature exists within it, this is very specific to a larger script I'm working on otherwise I'd totally resort to Andrew's :)

          • T
            In reply toTristan:
            Tristan Hoogland @Tristan
              2022-11-15 00:16:30.085Z

              And just like that found something close enough in the forum! Gotta dig deep in this place sometimes!

              here's the link for anyone wondering
              Select Track Based on Partial Name of Insert

              1. samuel henriques @samuel_henriques
                  2022-11-15 01:11:08.060Z2022-11-16 22:52:22.868Z

                  Hello Tristan and @Philip_weinrobe,
                  By default it will ignore inactive tracks and inactive inserts on active tracks, but I left an option to include. Make a list of plug-in names at the end.
                  Try this,

                  /**
                   * @param {array} plugNames
                   * @param {boolean} includeInactive
                   */
                  function selectTrackskWithPlugName(plugNames, includeInactive) {
                  
                      sf.ui.proTools.trackDeselectAll();
                      const visibleTrackNames = sf.ui.proTools.visibleTrackNames;
                      let foundTracks = []
                  
                      //Loop visible tracks
                      for (let i = 0; i < visibleTrackNames.length; i++) {
                          const trackName = visibleTrackNames[i]
                  
                          const track = sf.ui.proTools.trackGetByName({ name: trackName }).track
                          const muteBtn = track.buttons.whoseTitle.is("Mute").first
                          if (!muteBtn.exists) continue;
                  
                          //Inactive tracks
                          const isTrackInactive = muteBtn.value.value.startsWith('inactive')
                          if (isTrackInactive && !includeInactive) continue;
                  
                          //Loop insert btns
                          for (let i = 0; i < 9; i++) {
                  
                              const insertBtn = track.insertButtons[i]
                              if (!insertBtn.exists) break;// exit insert loop
                              const insertSelectorBtn = track.insertSelectorButtons[i]
                  
                              //Inactive plugs
                              let isPlugInactive = insertSelectorBtn.value.invalidate().value === "inactive"
                  
                              if (isPlugInactive && !includeInactive) continue;
                  
                              const plugName = insertBtn.value.invalidate().value
                              if (plugNames.includes(plugName)) {
                                  foundTracks.push(track.normalizedTrackName)
                                  break;// exit insert loop
                              };
                  
                          };
                      };
                      if (foundTracks.length === 0) { alert(`No track found with plug-in ${plugNames.slice().join(" or ")}.`); return; }
                      sf.ui.proTools.trackSelectByName({ names: foundTracks });
                  };
                  
                  
                  /**
                   * @param {object} param
                   * @param {string[]} param.plugNames
                   * @param {boolean} [param.includeInactive]
                   */
                  function selectTracksWithPlug_in({ plugNames, includeInactive = false }) {
                  
                      sf.ui.proTools.invalidate();
                  
                      // Get disabled viwes
                      const disabled = ["Inserts A-E", "Inserts F-J"].filter(view => !sf.ui.proTools.getMenuItem("View", "Edit Window Views", view).isMenuChecked);
                      //Enable Disabled Views
                      disabled.map(view => sf.ui.proTools.menuClick({ menuPath: ["View", "Edit Window Views", view], targetValue: "Enable" }));
                      //try {
                      selectTrackskWithPlugName(plugNames, includeInactive)
                  
                      /*   } catch (err) {
                            throw err;
                        } finally { */
                  
                      // Return Views to original state
                      disabled.map(view => sf.ui.proTools.menuClick({ menuPath: ["View", "Edit Window Views", view], targetValue: "Disable" }));
                      // }
                  };
                  
                  
                  selectTracksWithPlug_in({ plugNames: ["EQ3 1-Band", "RVox"] });
                  //selectTracksWithPlug_in({ plugNames: ["EQ3 1-Band", "RVox"], includeInactive: false })
                  
                  Reply2 LikesSolution
                  1. TTristan Hoogland @Tristan
                      2022-11-15 01:23:05.019Z

                      dude. you are a genius. absolutely perfect for me!! thanks so much for coming up with something promptly too.

                      1. samuel henriques @samuel_henriques
                          2022-11-15 01:23:54.660Z

                          awesome it's working.
                          Just updated a version that should be slightly faster.

                          1. TTristan Hoogland @Tristan
                              2022-11-15 01:41:14.384Z

                              feels great man! you crushed it.

                              1. samuel henriques @samuel_henriques
                                  2022-11-15 10:58:25.827Z

                                  Just made a new update, trying to make it a bit faster.

                                  1. TTristan Hoogland @Tristan
                                      2022-11-16 21:51:04.863Z

                                      Hey Sam. Everything's working great here, the only thing that it's still missing is ignoring inactive plugin states. It ignores inactive tracks fine though! Don't suppose you have a solution to that?

                                      1. samuel henriques @samuel_henriques
                                          2022-11-16 22:05:58.219Z

                                          uhh, should do it... Let me see what I did wrong

                                          1. samuel henriques @samuel_henriques
                                              2022-11-16 22:32:48.070Z

                                              Yep it's working here,
                                              just to clarify includeInactive: true is meant to select tracks that are inactive with the plug names you supplied and inactive plugs on any track.
                                              To ignore them either don't use the option or set it includeInactive: false

                                              1. samuel henriques @samuel_henriques
                                                  2022-11-16 22:54:16.608Z

                                                  UPDATED, just clarified some bits but is working the same way

                                                  Tristan let me know if you still have the same issue, maybe make a screen recording and I'll try t figure it out

                                                  1. TTristan Hoogland @Tristan
                                                      2022-11-16 23:05:26.433Z

                                                      Sam whatever you JUST did worked perfectly!! Working in all circumstances. You are my hero. Thank you!