No internet connection
  1. Home
  2. Macro and Script Help

Does "wait for no modals" work in RX editor? If not, what would achieve same result?

By DJH @DJH
    2022-04-25 20:43:31.035Z

    Title

    Does "wait for no modals" work in RX editor? If not, what would achieve same result?

    What do you expect to happen when you run the script/macro?

    This macro should send selection from PT to RX, apply leveler, send back and spot into PT

    Are you seeing an error?

    What happens when you run this script?

    Pulling my hair out here, I've tried many varations....

    The first issue i had was getting the macro to wait until the correct moment to apply leveler. I've finally got that mostly working for my purposes (though it fails on longer selections at the moment, something i'd like to refine soon).

    Main issue at the moment is getting the macro to wait until the leveler processing in RX editor is complete before it sends back to pro tools. I've tried:

    • "wait for no modals" (currently in the script)
    • selecting the exact progress bar window in RX and trying to get SF to "wait" until it disappears
    • Various insertions of activating RX and RX main window
    • Various attempts at applying time-based waits at different points in the process, which kind of work sometimes, but i think only because enough time passes for the Levelor proccessing to complete, not because the macro is understanding when the processing is complete.

    In short, it doesn't seem that SF is recognizing whats happening in RX.

    Help much appreciated, thanks....

    How were you running this script?

    Other

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "This macro should send selection from PT to RX, apply leveler, send back and spot into PT",
        "inputIsError": false,
        "inputWhatHappens": "Pulling my hair out here, I've tried many varations.... \n\nThe first issue i had was getting the macro to wait until the correct moment to apply leveler. I've finally got that mostly working for my purposes (though it fails on longer selections at the moment, something i'd like to refine soon).\n\nMain issue at the moment is getting the macro to wait until the leveler processing in RX editor is complete before it sends back to pro tools. I've tried:\n\n-  \"wait for no modals\" (currently in the script)\n-  selecting the exact progress bar window in RX  and trying to get SF to \"wait\" until it disappears\n- Various insertions of activating RX and RX main window\n- Various attempts at applying time-based waits at different points in the process, which kind of work sometimes, but i think only because enough time passes for the Levelor proccessing to complete, not because the macro is understanding when the processing is complete. \n\nIn short, it doesn't seem that SF is recognizing whats happening in RX.\n\nHelp much appreciated, thanks....",
        "inputHowRun": {
            "key": "-MpfwoFyZNOpBC3X5xGI",
            "title": "Other"
        },
        "inputImportance": 5,
        "inputTitle": "Does \"wait for no modals\" work in RX editor? If not, what would achieve same result?"
    }

    Source

    //Macro converted to script
    
    
    //Calling command "✅ Activate: PT (MW)" from package "📦 My Big Package  📦"
    sf.soundflow.runCommand({
        commandId: 'user:ckznokpwy0006jm10hci4cori:cl17diohm00080410ttw65otj',
        props: {}
    });
    
    //Calling command "RX 9 Connect Open and Send" from package "📦 My Big Package  📦"
    sf.soundflow.runCommand({
        commandId: 'package:cl17bb4mo00030410v1uvon6a',
        props: {}
    });
    
    sf.ui.proTools.waitForNoModals();
    
    //Calling command "⏰ Wait: RX-9 to be active" from package "📦 My Big Package  📦"
    sf.soundflow.runCommand({
        commandId: 'user:ckznokpwy0006jm10hci4cori:cl17dh7uo00070410eog0gfqv',
        props: {}
    });
    
    sf.ui.izotope.mainWindow.elementWaitFor();
    
    //Calling command "✅ Activate: RX-9 (MW)" from package "📦 My Big Package  📦"
    sf.soundflow.runCommand({
        commandId: 'package:cl17djw4f000904100ddfss7s',
        props: {}
    });
    
    sf.ui.proTools.waitForNoModals();
    
    sf.wait({
        intervalMs: 1000,
    });
    
    sf.keyboard.press({
        keys: "cmd+alt+numpad 0",
    });
    
    sf.ui.proTools.waitForNoModals();
    
    //Calling command "iZotope RX: Render & Spot Back into Pro Tools" from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/-LBuxGOleJlHe49Mn9gQ/cl1l9fhy90000dc10jzed79qu")
    sf.soundflow.runCommand({
        commandId: 'user:cl17624j10005h010jbt0in1q:-LCCGaRwIfn15Z7ExLP6',
        props: {}
    });
    
    sf.interaction.notify({
        title: "done",
    });
    
    
    

    Links

    User UID: 5oOYQAmkSMeJJ8UYzehWUfmvCyr1

    Feedback Key: sffeedback:5oOYQAmkSMeJJ8UYzehWUfmvCyr1:-N0XSkmfRqgPJojBrbpF

    Feedback ZIP

    • 8 replies
    1. Kitch Membery @Kitch2022-04-25 21:12:49.982Z

      Hi @DJH,

      Yeah, the Wait for modals is a Pro Tools method, you can tell this by the start of the modals line sf.ui.proTools.

      Waiting for the "Task Progress View" window works differently, but it can be done.

      The Following script will;

      • Activate RX's main window.
      • Open and the "Leveler" module.
      • Click "Set Clip Gain".
      • Waits 500 milliseconds for the Modal / Task Progress View window to appear.
      • Waits forever (timeout: -1) window to disappear.
      • Logs "Leveler Done".

      Hopefully that will help you get you to the next stage in your script.

      sf.ui.izotope.appActivateMainWindow();
      
      sf.ui.izotope.menuClick({
          menuPath: ["Modules", "Leveler..."],
          targetValue: "Enable",
      });
      
      const levelerWin = sf.ui.izotope.windows.whoseTitle.is("Leveler").first;
      const effectPanel = levelerWin.groups.whoseDescription.is("EffectPanel Leveler").first;
      const effectSubPanel = effectPanel.groups.whoseDescription.is("EffectPanel Leveler").first;
      const effectPanelFooter = effectSubPanel.groups.whoseDescription.is("EffectPanel Leveler Footer Background").first;
      const setClipGainBtn = effectPanelFooter.buttons.whoseDescription.is("Apply").first;
      
      levelerWin.elementWaitFor();
      
      setClipGainBtn.elementClick();
      
      //Delay needed to wait for the iZotope "Task Progress View" to appear
      sf.wait({ intervalMs: 500 });
      
      //Wait for "Task Progress View" to disappear
      sf.ui.izotope.windows.first.groups.whoseDescription.is("Task Progress View").first.elementWaitFor({
          waitType: "Disappear",
          timeout: -1, // Press "Control + Shift + Esc" to cancel if the script fails;
      });
      
      log("Leveler Done");
      

      I hope that helps :-)

      1. DDJH @DJH
          2022-04-25 23:09:46.351Z2022-04-26 00:45:03.727Z

          thank you so much @Kitch. This part of the script is working much better. Still having issues with longer files (past 10 or 15 mins) getting sent back too early or not at all, though. But thinking maybe I've narrowed it down to the first part of the macro? The "wait for no modals" part of the script at the beginning doesn't seem to be doing anything? Also note I'm not using the stock send-to-izotope command because its opening rx 7 connect on my machine (which is also installed) which is why i made my own script for rx 9 connect...

          sf.ui.proTools.appActivateMainWindow();
          
          //Calling command "Open AudioSuite Plugin" from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/ckyu15xww00004v10dq15rpgq")
          sf.soundflow.runCommand({
              commandId: 'user:ckp49i4j60000a2100yfwywgf:ckoyb9rgl000aua10o6xfz6v5',
              props: {
                  category: "Noise Reduction",
                  pluginName: "RX 9 Connect",
              }
          });
          
          sf.ui.proTools.firstAudioSuiteWindow.audioSuiteSetOptions({
              processingInputMode: "EntireSelection",
              processingOutputMode: "CreateContinuousFile",
          });
          
          sf.ui.proTools.firstAudioSuiteWindow.buttons.whoseTitle.is("Analyze").first.elementClick();
          
          sf.ui.proTools.waitForNoModals();
          
          /* sf.wait({
              intervalMs: 300,
          }); */
          
          sf.ui.izotope.appWaitForActive();
          
          sf.ui.izotope.mainWindow.elementWaitFor();
          
          //Calling command "Kitch Leveler Script" from package "📦 My Big Package  📦"
          sf.soundflow.runCommand({
              commandId: 'user:ckznokpwy0006jm10hci4cori:cl2fb3vmr00088i10s7brovas',
              props: {}
          });
          
          sf.wait({
              intervalMs: 500,
          });
          
          sf.keyboard.press({
              keys: "cmd+return",
          });
          
          sf.ui.proTools.appWaitForActive();
          
          sf.ui.proTools.firstAudioSuiteWindow.buttons.whoseTitle.is("Render").first.elementClick();
          
          sf.wait({
              intervalMs: 300,
          });
          
          sf.ui.proTools.waitForNoModals();
          
          //Calling command "Close First AudioSuite plugin" from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/ckyu15xww00004v10dq15rpgq")
          sf.soundflow.runCommand({
              commandId: 'user:ckp49i4j60000a2100yfwywgf:ckydgt59600003110hy9vb7kb',
              props: {}
          });
          
          1. In reply toKitch:
            Kitch Membery @Kitch2022-12-14 22:17:55.648Z

            Hi @Owen_Granich_Young,

            In the hangout today you asked about the modals in RX, this should work. Have not thoroughly tested it though. Let me know how it goes.

            //Delay needed to wait for the iZotope "Task Progress View" to appear
            sf.wait({ intervalMs: 500 });
            
            //Wait for "Task Progress View" to disappear
            sf.ui.izotope.windows.first.groups.whoseDescription.is("Task Progress View").first.elementWaitFor({
                waitForNoElement: true,
                timeout: -1, // Press "Control + Shift + Esc" to cancel if the script fails;
            });
            

            I made an update to the elementWaitFor() method, I changed the wait time to waitForNoElement: true, as it seems like a better approach. You may also want to set the timeout value to something like 4 seconds so it does not wait forever. :-)

            Rock on!

            1. JJonathan Wales @Jonathan_Wales
                2022-12-30 06:41:05.797Z2022-12-30 06:51:23.123Z

                I'm also interested (and failing) to get Izotope to detect and wait for processing to finish. My script is basically taking a clip from ProTools into RX. Then running a process by using a pre-defined shortcut in RX. The idea would be to wait till this is finished, then automatically send back to PT. However I've tried to use the methods above and none of them are still respecting the progress bar. The script is just proceeding after the wait time (for the bar to show up) is over. In my case - here is what's displayed. 9 seconds remaining (but obviously that's different each time, hence the need to detect it being finished)

                There are 2 other tests that could be used. The most obvious being that upon completion, Izotope puts an entry into the "History" field. Would this be able to be used as a method of detection? Thoughts?

                1. Kitch Membery @Kitch2023-01-01 03:12:26.737Z

                  Good Idea @Jonathan_Wales.

                  To do this you could use the following function.

                  function waitForRxModals() {
                      const izotope = sf.ui.izotope;
                      const mainWindow = izotope.mainWindow;
                      //izotope.appActivateMainWindow();
                      izotope.invalidate();
                  
                      const getGroupByName = (parent, name) => parent.groups.whoseDescription.is(name).first;
                  
                      const undoPanel = getGroupByName(mainWindow, "Undo Panel");
                  
                      const oldHistoryRowCount = undoPanel.radioButtons.count;
                  
                      while (oldHistoryRowCount === undoPanel.radioButtons.count) {
                          sf.wait({ intervalMs: 100 });
                      }
                  }
                  
                  log("Start Processing");
                  
                  waitForRxModals();
                  
                  log("Done Processing");
                  

                  Rock on!

            2. J
              In reply toDJH:
              Jonathan Wales @Jonathan_Wales
                2022-12-30 06:51:57.127Z

                Labels in History after a process is completed. (before and after shots)

                Before

                1. JJonathan Wales @Jonathan_Wales
                    2022-12-30 06:52:05.708Z

                    After

                  • J
                    In reply toDJH:
                    Jonathan Wales @Jonathan_Wales
                      2023-01-01 16:48:58.853Z

                      This works for individual processing. Perfectly.

                      For a module chain (which places and entry in the undo for the FIRST function completed, and then revises it for subsequent entries (under a triangle which remains closed) then it doesn't detect the full suite of processes.