Hi All,
For anyone interested:
I've noticed since updating to the latest version of Pr Tools (2022.4.0), for any scripts that uses the Preset Toogle functions eq "Bounce Mix" and the "Import Session Data", the script needs to change slightly to work as they have different names now.
For Example,
This code
sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.whoseTitle.is("Preset Toggle").first.elementClick();
Needs to be changed to add a "1" for the "Preset Toggle", like so.
sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.whoseTitle.is("Preset Toggle 1").first.elementClick();
Not sure if this is the best fix, maybe someone else knows better.
I have had to double up some scripts as I use 2022.4.0 at home, and 2021 at work.
Hope this helps.
Cheers
Mitch
- Christian Scheuer @chrscheuer2022-05-05 14:33:35.603Z
Thanks for sharing!
Chris Shaw @Chris_Shaw2022-05-06 02:03:54.229Z
Ugh!
- In reply toMitch_Willard_the2nd⬆:Andrew Scheps @Andrew_Scheps
The best way I've found to deal with this is just use:
let presetButtons = sf.ui.proTools.windows.whoseTitle.is("Bounce Mix").first.buttons.allItems.filter(b => b.title.value.includes("Preset"));
This will give you an array, in order, of the 5 preset buttons. Obviously if they change the order at any point this could be an issue, but this way you don't need separate code and Pro Tools version checking.
And if you only need one button you can short-circuit the code to pick it out of the array in the same line.
I've tested this on PTs 21.12 and 22.4 and it seems to work fine.
Mitch Willard @Mitch_Willard
Awesome! Thanks @Andrew_Scheps