No internet connection
  1. Home
  2. How to

Wait for Render window

By Thomas Gloor @Thomas_Gloor
    2021-06-30 16:40:59.515Z

    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.

    • 13 replies
    1. samuel henriques @samuel_henriques
        2021-06-30 17:13:50.086Z

        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();
        
        1. TThomas Gloor @Thomas_Gloor
            2021-06-30 17:54:09.655Z

            Hey @samuel_henriques

            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,

            1. samuel henriques @samuel_henriques
                2021-06-30 18:09:56.502Z

                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.

                1. samuel henriques @samuel_henriques
                    2021-06-30 18:40:57.724Z

                    Does it work?
                    Let me know if you get stuck.

                    1. TThomas Gloor @Thomas_Gloor
                        2021-07-01 07:34:50.516Z

                        Hey @samuel_henriques

                        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.

                        1. samuel henriques @samuel_henriques
                            2021-07-01 09:04:20.460Z

                            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.

                  • T
                    In reply toThomas_Gloor:
                    Thomas Gloor @Thomas_Gloor
                      2021-07-01 09:30:27.526Z

                      @samuel_henriques

                      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.

                      1. samuel henriques @samuel_henriques
                          2021-07-01 09:51:53.606Z

                          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.

                          1. TThomas Gloor @Thomas_Gloor
                              2021-07-01 10:04:26.458Z

                              @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?

                              1. samuel henriques @samuel_henriques
                                  2021-07-01 10:20:17.700Z

                                  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 this sf.wait({ intervalMs: 2000 });

                                  1. TThomas Gloor @Thomas_Gloor
                                      2021-07-01 10:26:55.215Z

                                      @samuel_henriques OK! Got it! Thank you.

                                      VERY last question though. This should work when clicking CAPTURE aswell, am I right?

                                      1. samuel henriques @samuel_henriques
                                          2021-07-01 10:43:43.105Z

                                          Thats the idea yes, but let me know if it's not working.

                                        • JJP D. @JP_D
                                            2024-03-01 21:39:03.931Z

                                            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!!!!