Hey!
I've seen the discussions around toggling the visibility of audiosuite plugins. Is this possible to do with a plugin inserted on a track?
- HIn reply toHouston_Snyder⬆:Houston Snyder @Houston_Snyder
Actually the macro "Open insert on track" works. It will toggle my dorrough meter open and close. But, as soon as i turn the target button off. It stops functioning. Any ideas how to solve? Here is the script from that macro.
sf.ui.proTools.trackGetByName({ name: "MASTERBUS", makeVisible: true }).track.trackInsertToggleShow({ insertNumber: 4, });
Christian Scheuer @chrscheuer2020-04-02 17:55:57.921Z
Hi Houston.
Yes
trackInsertToggleShow
only works on the targeted insert in that slot.If you want to close the insert, you'll need a script that finds the window and if it finds it, to close it.
Something like this:
function toggleUntargetedInsertPlugin({ pluginName, trackName, insertNumber }) { var pluginWindow = sf.ui.proTools.floatingWindows.whoseTitle.is('Plug-in: ' + pluginName).filter(w => { var trackSelectorBtn = w.popupButtons.whoseTitle.is('Track Selector').first; return trackSelectorBtn.exists && trackSelectorBtn.value.invalidate().value === trackName; })[0]; if (pluginWindow && pluginWindow.exists) { //Plugin is open, so close it pluginWindow.windowClose(); } else { //Plugin is not open, so open it var newPluginWindow = sf.ui.proTools.trackGetByName({ name: trackName, makeVisible: true }).track.trackInsertToggleShow({ insertNumber, }).window; //Untarget plugin newPluginWindow.buttons.whoseTitle.is('Target button').first.elementClick(); } } toggleUntargetedInsertPlugin({ trackName: 'MASTERBUS', pluginName: 'Dorrough', insertNumber: 1, });
Christian Scheuer @chrscheuer2020-04-02 17:58:27.371Z
You could experiment with adding a
windowMove
action after the untarget call, to make sure the window always ends up on the same place on your screen (PT won't remember it):newPluginWindow.windowMove({ position: { x: 400, y: 400 }, });
- HHouston Snyder @Houston_Snyder
Both Scripts worked perfectly! I was also able to make multiple plugins open. So like I can toggle all my comps up and down or all the master bus stuff. Super useful! Thanks as always!
Christian Scheuer @chrscheuer2020-04-02 20:42:07.888Z
Thanks for coming up with good ideas :) I will definitely use this as well.
- In reply tochrscheuer⬆:SScott Robinson @Scott_Robinson
Hi Christian, is there a way to simulate a “shift click” when opening the plugin?
Chad Wahlbrink @Chad2025-05-02 21:40:29.893Z
Hi, @Scott_Robinson,
You can simulate a shift click for an insert like this:
sf.ui.proTools.selectedTrack.insertButtons[0].mouseClickElement({ isShift: true })
or as a Macro like this:
This is a bit less robust than addressing the "Target Button" with
elementClick()
, as Christian did above. Mouse and Keyboard simulation, using `mouseClickElement()', requires the element to be shown on screen and for Pro Tools to be focused. As a result, it's more prone to errors.elementClick()
can run in the background and uses deeper accessibility hooks to ensure reliability; however, it cannot accept keyboard modifiers like amouseClick
.- SScott Robinson @Scott_Robinson
Thanks Chad, do you know if elementClick() is still the best way to open a plugin window?
Chad Wahlbrink @Chad2025-05-03 20:11:35.415Z
The SoundFlow team generally tries to use
elementClick()
overmouseClickElement()
for most actions.Since we can reliably use
elementClick()
to open the plug-in window and then useelementClick()
on that plug-in's window after it's open, that would be recommended.I don't believe there is a SDK command for this function yet.
- DIn reply toHouston_Snyder⬆:Daniel Lee @Daniel_Lee
Hi Houston & Christian, just curious as to what are the advantages of this command over using windows configuration?
Christian Scheuer @chrscheuer2020-04-15 11:32:58.651Z
I think they're just two different tools.
What immediately comes to mind for me is:- Window configurations are full (and fairly static) configurations of your setup, where these scripts allow you to dynamically change the visibility of individual plugins via shortcuts. You might want to just ensure that one plugin is shown, but not change anything else.
- In some cases window configs can be slow to load.
- DDaniel Lee @Daniel_Lee
Ah ok! Got it!
Thanks Christian!