Hi there,
I'm using this piece of script to enable the Quantize window in Pro Tools:
sf.ui.proTools.menuClick({
menuPath: ["Event", "Event Operations", "Quantize..."],
targetValue: 'Enable'
}); >
However, rather than hard-enabling it, it's just toggling it. Which is a problem if the window is already open as the function toggles it closed before running any attached scripts. Am I invoking this window correctly, or is this a PT issue?
Many Thanks!
Trystan
- TT Francis @T_Francis
By the way, this seems to be happening with any invocation of the Quantize window, including the packaged "Event Menu: Event - Quantize" macro in Soundflow. Regardless of wether the buttons are set to Enable, Disable or Toggle, the window will only toggle.
Christian Scheuer @chrscheuer2024-03-20 16:00:16.191Z
I looked into this. The
targetValue: 'Enable'
option is designed to allow you to click a menu item that isn't "checked". In this case, Pro Tools apparently doesn't make that menu item "checked" when the window is open, which is why you're seeing this problem.You can do something like this instead to make sure the window is open:
if (!sf.ui.proTools.windows.some(w => w.children.whoseRole.is("AXStaticText").whoseValue.is("Quantize").first.exists)) { sf.ui.proTools.menuClick({ menuPath: ["Event", "Event Operations", "Quantize..."], }); }
- TT Francis @T_Francis
Thanks Christian,
If I take your script as verbatim and add it to a button on the stream deck, it still just toggles the window open and closed. Should I be using it in a different way?
Just to make sure my intent is clear, I want that piece of script to sit at the top of my various quantize macros and open the quantize window if it's closed, but leave it open if it's already open. Currently this is closing the window if it's already open.
Thanks for your continued help!
Trystan
Christian Scheuer @chrscheuer2024-03-20 16:16:00.092Z
Hm, that's odd, but it's probably because that window is appearing differently on your version of Pro Tools. What version are you running?
This script works to ensure the window is open (and not close it) on PT 2024.3
- TT Francis @T_Francis
Currently 2022.12.0 - basically we don't like to do updates mid-project and...we've not yet had that luxury!!
T
Christian Scheuer @chrscheuer2024-03-20 16:30:08.937Z
Gotcha. In 2022.12, it's a bit simpler:
if (!sf.ui.proTools.windows.whoseTitle.is("Event Operations").first.exists) { sf.ui.proTools.menuClick({ menuPath: ["Event", "Event Operations", "Quantize..."], }); }
- TT Francis @T_Francis
That's the ducky!
Brilliant. And now I also have the most up to date code for when we do finally update!
Thanks again for your help, Christian!
- In reply toT_Francis⬆:Christian Scheuer @chrscheuer2024-03-20 15:56:32.842Z
Hi T,
I'll take a look at this. Please see here for how to quote code on the forum:
- TT Francis @T_Francis
Thankyou for that -
I Shall Do This in the future!