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!
- Mitch Willard @Mitch_Willard
Hey @Tristan_Hoogland ,
Check out in the store the Scheps Track Selector, it'll do what you're asking plus more, super powerful.
Mitch
- TTristan Hoogland @Tristan
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 :)
- TIn reply toTristan⬆:Tristan Hoogland @Tristan
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 Insertsamuel henriques @samuel_henriques
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 })
- TTristan Hoogland @Tristan
dude. you are a genius. absolutely perfect for me!! thanks so much for coming up with something promptly too.
samuel henriques @samuel_henriques
awesome it's working.
Just updated a version that should be slightly faster.- TTristan Hoogland @Tristan
feels great man! you crushed it.
samuel henriques @samuel_henriques
Just made a new update, trying to make it a bit faster.
- TTristan Hoogland @Tristan
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?
samuel henriques @samuel_henriques
uhh, should do it... Let me see what I did wrong
samuel henriques @samuel_henriques
Yep it's working here,
just to clarifyincludeInactive: 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 itincludeInactive: false
samuel henriques @samuel_henriques
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
- TTristan Hoogland @Tristan
Sam whatever you JUST did worked perfectly!! Working in all circumstances. You are my hero. Thank you!