I've searched and cannot quite find the answer for this one. I've got a script working where I do a gain change process on files and then want to open the batch renaming function. I've got it working by placing a wait for 3333 ms after the gain function before the key command to launch the batch renamer. I'm wondering if there is a wait script that would wait for the audiosuite gain function to finish before pushing the key command. I found the process for bouncing but it's not working for me. Thoughts?
Linked from:
- Kitch Membery @Kitch2020-10-01 02:22:08.217Z
Hi Chip...
Simply use the "Wait for Modals" action in the macro editor instead of the 3333ms wait or the following code;
sf.ui.proTools.waitForNoModals();
Let me know if that works for you :-)
Rock on!
Chip Sloan @ChipSloan
I had tried that but I get an error. Perhaps I have a syntax error somewhere??
Here's my script attempt, it works with the ms wait but if I comment that and replace with the modal script it errors.sf.ui.proTools.appActivateMainWindow(); var asWin = sf.ui.proTools.getAudioSuiteWindow("Gain"); if (!asWin.exists) { asWin = sf.ui.proTools.audioSuiteOpenPlugin({ category: 'Other', name: "Gain" }).window; } asWin.audioSuiteSetOptions({ processingInputMode: "ClipByClip", processingOutputMode: "CreateIndividualFiles", }); sf.ui.proTools.firstAudioSuiteWindow.buttons.whoseTitle.is('Render').first.elementClick(); //sf.wait({ // intervalMs: 3333, //}); sf.ui.proTools.waitForNoModals(); sf.keyboard.press({ keys: "ctrl+shift+r", }); sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.buttons.whoseTitle.is('Preset Toggle').first.elementClick(); sf.keyboard.press({ keys: "numpad enter", }); sf.ui.proTools.audioSuiteOpenPlugin({ category: "Sound Field", name: "Insight 2", });
Kitch Membery @Kitch2020-10-01 02:50:35.827Z2020-10-01 04:01:33.620Z
Try this mate :-)
//Activate Pro Tools main window sf.ui.proTools.appActivateMainWindow(); var asWin = sf.ui.proTools.getAudioSuiteWindow("Gain"); //Open Audiosuite "Gain" if (!asWin.exists) { asWin = sf.ui.proTools.audioSuiteOpenPlugin({ category: 'Other', name: "Gain" }).window; } //Select Audiosuite Options asWin.audioSuiteSetOptions({ processingInputMode: "ClipByClip", processingOutputMode: "CreateIndividualFiles", }); //Render and wait for render to complete asWin.audioSuiteRender(); //Open Batch Rename... sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({ menuPath: ["Batch Rename..."], }); //Wait for Batch Clip Name... Window sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.elementWaitFor(); //Click preset 1 sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.buttons.whoseTitle.is('Preset Toggle').first.elementClick(); //Click OK sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.buttons.whoseTitle.is('OK').first.elementClick(); //Wait for Batch Clip Name... Window to dissapear sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.elementWaitFor({waitType:'Disappear'}); sf.ui.proTools.audioSuiteOpenPlugin({ category: "Sound Field", name: "Insight 2", });
Dustin Harris @Dustin_Harris
On a mobile so I can’t check it, but isn’t there a method for audiosuite plugins at combines render and waitForNoModals? It was something like
asWin.audioSuiteRender()
?Kitch Membery @Kitch2020-10-01 04:03:25.539Z
Of course... Thanks Dustin I forgot about that :-)
I've updated the script.
Christian Scheuer @chrscheuer2020-10-01 09:39:50.806Z
Yes -
audioSuiteRender
is the best way to do this, since it takes into account the potential for very quick processing or even delays in bringing up the progress bar, which waitForNoModals inherently doesn't.
- In reply toChipSloan⬆:Chris Roberts @Chris_Roberts
Hi
I've been playing with some of this script, but have hot a roadblock!
How do I change the script:
//Click preset 1
sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.buttons.whoseTitle.is('Preset Toggle').first.elementClick();
so that I can click other preset buttons .e.g. Preset 4
Thanks in advance for any help!
Chris Roberts @Chris_Roberts
Apologies, quoting script correctly this time!
//Click preset 1 sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.buttons.whoseTitle.is('Preset Toggle').first.elementClick();
Christian Scheuer @chrscheuer2021-12-05 23:07:44.194Z
Hi Chris,
Try this:
sf.ui.proTools.windows.whoseTitle.is('Batch Clip Rename').first.buttons.whoseTitle.is('Preset Toggle').allItems[0].elementClick();
Switch out the 0 with 1 for the 2nd preset (the array is 0-indexed)
Chris Roberts @Chris_Roberts
Thanks Christian!