Hello, teachers!
I have several plugin windows open, and I only want to close the one with the target button enabled.
What are the possible methods?
I tried
var tartgetStatus = sf.ui.proTools.windows.whoseTitle.is("Plug-in: FabFilter Pro-Q 3").first.buttons.whoseTitle.is("Target button").first.value.invalidate().value;
log(targetStatus)
When I try this, the status does not show anything, so does the target button not have a value?
Please let me know if you have a solution.
Best regards.
- Kitch Membery @Kitch2021-09-09 21:50:00.983Z
Unfortunately you are correct in your findings. Pro Tools does not report the target button's "Selected" state. :-(
- In reply toYujiro_Yonetsu⬆:samuel henriques @samuel_henriques
Hello Yujiro,
Unfortunately, that's the case.
Now, if you want do close all but one audioSuite window.
Select/ focus the one you want to keep open and run this script.
It will close all audioSuite windows not selected/ focused
If any of the windows is the same plugin as the one you want to keep open, all the instances of that plugin won't close.sf.ui.proTools.appActivateMainWindow() const selectedAudiosuite = sf.ui.proTools.firstAudioSuiteWindow.title.invalidate().value sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Audio Suite').allItems.forEach(function (win) { try { if (win.title.value != selectedAudiosuite) { win.windowClose(); } } catch (err) { } });
Yujiro Yonetsu @Yujiro_Yonetsu
Thank you for your answer!
But what I want to do is not about the Audio suite, but about the insert plugin window.
Is there any way to apply this?samuel henriques @samuel_henriques
here you go, this will close all but the first / focused plug-in
sf.ui.proTools.appActivateMainWindow() const [focusedPlug, ...others] = sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in:').map(x => x) others.forEach(function (win) { try { win.windowClose(); } catch (err) { } });
Yujiro Yonetsu @Yujiro_Yonetsu
Thank you.
I verified the script I was taught.
I'm still trying to figure out that script.However, the movement seems to be the opposite of what I want.
How can I use the script you gave me to make it work the other way around?
I want to close only the plugin window that is in focus.Please teach me!!!
samuel henriques @samuel_henriques
Hello Yujiro,
I apologise, completely misread your first post.try this,
sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in:').first.windowClose()
Yujiro Yonetsu @Yujiro_Yonetsu
Thank you!
But, This will close all the plugin windows.
What I want to do is to close only the focused plugin window.In this case, I have a meter plug-in that is always visible on the edge of the screen with the target button off.
Then when I do an insert or something while working, a new plugin window opens.
I only want to close that window, and leave the metering system visible.Would I be able to do that?
samuel henriques @samuel_henriques
On mine, this last script is closing only the foremost one.
But if you want to close all except that meter one, I guess we could do something to close all except the one with that name.
Witch one is it?samuel henriques @samuel_henriques
here, try this,
with this one, it doesn't matter whats selected/focused
just change the plug-in name with the one you want opensf.ui.proTools.appActivateMainWindow() const openedPlugins = sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in:').map(x => x) openedPlugins.forEach(function (win) { try { if (win.title.invalidate().value != "Plug-in: FabFilter Pro-Q 2") win.windowClose(); } catch (err) { } });
Yujiro Yonetsu @Yujiro_Yonetsu
Thank you again and again.
How do I describe this so that I don't close multiple plugins?
I tried this
const openedPlugins = sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in:').map(x => x) openedPlugins.forEach(function (win) { try { if (win.title.invalidate().value != "Plug-in: FabFilter Pro-Q 3" || "Plug-in: NUGEN MasterCheck") win.windowClose(); } catch (err) { } });
However, this did not work.
And seems like it would work this way, though.
You said...sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in:').first.windowClose()
I'm wondering why this script doesn't cause only the foremost one to close in my environment...
samuel henriques @samuel_henriques
Not sure why we are getting different behaviour.
I'm away from my computer, I hope this makes sense, to chose more than one to keep open
if (win.title.invalidate().value != "Plug-in: FabFilter Pro-Q 3" || win.title.invalidate().value != "Plug-in: NUGEN MasterCheck")
Yujiro Yonetsu @Yujiro_Yonetsu
Sorry for the delay.
I was using the script you taught me to verify the results.
In the middle of it all, one mystery was solved.
If I use the following script
sf.ui.proTools.floatingWindows.whoseTitle.startsWith('Plug-in:').first.windowClose()
For some reason, all the windows were closed in my environment.
The reason for this was that I was using the keyboard shortcut "Control + Option + Command + any key" when I tested this script.
It seems that modifier keys such as "Option" were acting on the script.
I apologize for the inconvenience.So the above script solves the problem.
Thanks:)