Wait for Render window
Hi,
I'm trying to build a macro and would need it to wait for an audiosuite RENDER window (progression bar) to dissapear.
I thought I had it, but turn out it doesnt really work. Here is the code. Any input?
sf.ui.proTools.windows.whoseTitle.is('Render').first.elementWaitFor({
waitType: "Disappear",
timeout: 60000,
});
Best,
T.
- samuel henriques @samuel_henriques
Hello @Thomas_Gloor,
You can use
audioSuiteRender()
, it will wait for the render to finish.
Here's an example using RX 8 De-plosive:const pluginName = 'RX 8 De-plosive' const pluginWin = sf.ui.proTools.windows.whoseTitle.is(`Audio Suite: ${pluginName}`) ////////////////////////////// if (pluginWin.exists) { sf.ui.proTools.getAudioSuiteWindow(pluginName).audioSuiteRender(); } else { sf.ui.proTools.audioSuiteOpenPlugin({ category: "Noise Reduction", name: pluginName, }) pluginWin.first.buttons.whoseTitle.is('Target button').first.elementClick(); pluginWin.first.popupButtons.whoseTitle.is('Processing Output Mode').first.popupMenuSelect({ menuPath: ["create individual files"], }) sf.ui.proTools.getAudioSuiteWindow(pluginName).audioSuiteRender(); }
Or just the render line:
sf.ui.proTools.getAudioSuiteWindow('RX 8 De-plosive').audioSuiteRender();
- TThomas Gloor @Thomas_Gloor
Thank you very much for your answer. Just to be sure, if I add
sf.ui.proTools.getAudioSuiteWindow('RX 8 De-plosive').audioSuiteRender();
after a "render audiosuite" piece of code, it should work?
Best,
samuel henriques @samuel_henriques
No, this will click the render button and wait for it to end.
just replace
'RX 8 De-plosive'
with the plugin name you are using.samuel henriques @samuel_henriques
Does it work?
Let me know if you get stuck.- TThomas Gloor @Thomas_Gloor
Yes! It seems to work perfectly (I tried using a long audio, approx 15 minutes) and it doesn't fail, so all seems well. THANK YOU :)
I do have a subsidiary question.
I very often use an audiosuite that has both a Capture (viewed by SF as Analyze) and a Spot (viewed by SF as Render) button.
I have to Capture two different audios, so that is two separate Captures. The first one is almost instant, but the second one varies according to the lenght of the audio.The following command will wait for the Render to complete.
sf.ui.proTools.getAudioSuiteWindow('RX 8 De-plosive').audioSuiteRender();
is there a command that would wait for the CAPTURE to complete?
Best,
T.
samuel henriques @samuel_henriques
Hello @Thomas_Gloor,
great it's working.
For other cases this should do the trick
//Wait for bounce/render to finish sf.ui.proTools.confirmationDialog.elementWaitFor({ waitType: 'Disappear', timeout: -1 }); //-1 is endless timeout (cancel by Ctrl+Shift+Esc)
timeout: -1
means it will wait forever.
- TIn reply toThomas_Gloor⬆:Thomas Gloor @Thomas_Gloor
thank you very much!
Just one last question, will the .confirmationDialog.elementWaitFor work for a Rendering progression bar or should I replace it with
sf.ui.proTools.renderWindow.elementWaitFor ({ waitType: 'Disappear', timeout: -1});
Best,
T.
samuel henriques @samuel_henriques
Hey Thomas,
If you see something redlined on the SoundFlow editor, it generally means it's an error. So to answer your question no, don't change it.
confirmationDialog
is what you have it it looks like this:The text inside is not relevant. Just that it doesn't have a title.
But test it a bit, you can make a clean script with this:
//Wait for bounce/render to finish sf.ui.proTools.confirmationDialog.elementWaitFor({ waitType: 'Disappear', timeout: -1 }); //-1 is endless timeout (cancel by Ctrl+Shift+Esc) log("end")
Now create a trigger for it,
Click analyse ,
press on trigger.If you get the log when the window disappears, you should be fine.
- TThomas Gloor @Thomas_Gloor
@samuel_henriques , thanks man!
Just to be sure, what would be a trigger for this? Shouldn't be the fact of clicking render a trigger already?
samuel henriques @samuel_henriques
Just that the line of code is after clicking on render will make it work.
I meant create a keyboard trigger so you can check that the line of script is working as intended.
and it's actually safer like this:
//Wait for bounce to finish (Wait for bounce dialog to appear, then to disappear) sf.wait(); sf.ui.proTools.confirmationDialog.elementWaitFor({ waitType: 'Disappear', timeout: -1 }); //-1 is endless timeout (cancel by Ctrl+Shift+Esc)
In the cases the window is too fast, you could get an error if you don't have the wait.
If you are getting any errors, try increasing the wait like thissf.wait({ intervalMs: 2000 });
- TThomas Gloor @Thomas_Gloor
@samuel_henriques OK! Got it! Thank you.
VERY last question though. This should work when clicking CAPTURE aswell, am I right?
samuel henriques @samuel_henriques
Thats the idea yes, but let me know if it's not working.
- In reply tosamuel_henriques⬆:JJP D. @JP_D
Used it on an import portion which had many files to be imported. The code fixed a lot of issues :)
Thank you so much for this!!!!