Open Any Fade Window run Preset and close
Mosty found the code on the forum, but consolidated here. Buttons 1-5 in any fade window, have the fade selected press your button, bam. I don't ever use keyboard 1-5 so i've placed these there and use them allll the time.
//Activate Pro Tools
sf.ui.proTools.appActivate();
sf.ui.proTools.invalidate();
sf.ui.proTools.menuClick({
menuPath: ["Edit","Fades","Create..."],
});
sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[0].elementClick(); ///0-4 is presets 1-5
sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is("OK").first.elementClick();
- RIn reply toOwen_Granich_Young⬆:Rakel Pascual @Rakel_Pascual
Hi Owen!
The script is working great!
I'm beginner in coding and I have some questions about:sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[0].elementClick(); ///0-4 is presets 1-5
How can I select my preset 2, for example?
Thanks!
- OOwen Granich-Young @Owen_Granich_Young
Hey @Rakel_Pascual sorry for the slow response been a busy week.
So you're in the right place -- the confusing this often is that Javascript starts at 0 instead of 1. So the
allItems[0]
part of the line is the part you want to change. It's currently set for preset one IE number 0, in order for it to be Preset 2 you'll want the Number in the allItemes[X] to read 1 ... so the full line for Preset 2 would read :sf.ui.proTools.windows.whoseTitle.contains('Fade').first.buttons.whoseTitle.is('Fade Preset Toggle').allItems[1].elementClick(); ///0-4 is presets 1-5
Also as an aside if you want I've templated this script and put it in my =CUTS= package in the store.
Bests,
Owen Granich-Young