No internet connection
  1. Home
  2. How to

Pro tools send clip to RX 7

By Martin Pavey @Martin_Pavey
    2019-09-11 21:51:59.628Z2019-09-11 22:04:43.745Z

    I've been trying to write a script which send a selected clip from PT to RX 7, I don't want it to be clip by clip.
    All I can do is open the RX7 connect window,

    sf.ui.proTools.audioSuiteOpenPlugin({
      category: "Noise Reduction",
      name: "RX 7 Connect",
    });
    

    I can't get anything to click on the 'send' button. When I
    try to make a script which clicks on the ui region 'send' it says its called 'analyse' and fails.
    I also can't get anything to click on the 'Render' button.
    In playing about with this I've found that the 'click relative to a UI element' shortcut, does not allow me to increment the X and Y parameters.
    Is this a bug?
    Thanks
    Martin

    Solved in post #3, click to view
    • 18 replies
    1. I can't get anything to click on the 'send' button. When I
      try to make a script which clicks on the ui region 'send' it says its called 'analyse' and fails.

      Yes, interestingly Pro Tools internally calls the "Send" button "Analyze", so that's not a bug just a curiosity of Pro Tools.
      It should be pretty easy to just send the audio without selecting Clip by Clip though. Let me check.

      I've found that the 'click relative to a UI element' shortcut, does not allow me to increment the X and Y parameters.

      Yea I've noticed this myself, it appears to be a bug. I'll have to investigate next week when I'm back at our main office. It should be a quick fix.

      1. Something like this should work for RX7:

        
        var win = sf.ui.proTools.getAudioSuiteWindow('RX 7 Connect');
        if (!win || !win.exists) {
            win = sf.ui.proTools.audioSuiteOpenPlugin({
                category: 'Noise Reduction',
                name: 'RX 7 Connect'
            }).window;
        }
        win.getFirstWithTitle("Analyze").elementClick();    
        
        ReplySolution
        1. In reply tochrscheuer:

          I'm getting this to work perfectly except...
          After rendering in ProTools how do I have it automatically close the RX7 Connect window?

          1. If you have a win variable from something like this: https://forum.soundflow.org/-970#post-3

            then you just call:

            win.windowClose();
            
            1. JJonathan Grossman @Jonathan_Grossman
                2020-04-20 21:29:08.806Z2020-04-21 11:01:50.301Z

                Here's my code but still not working. I think I have that - win.windowClose(); - code at the bottom

                var shuttleBtn = sf.ui.izotope.mainWindow.children.whoseDescription.endsWith('Main Window').first.children.whoseDescription.is("Shuttle").first;
                shuttleBtn.elementClick({}, "Could not click Send Back button");
                
                sf.wait({ intervalMs: 500 });
                
                sf.ui.proTools.appActivateMainWindow({}, "Could not activate Pro Tools");
                
                var win = sf.ui.proTools.floatingWindows.filter(function(w){ var t = w.title.value; return t.indexOf("Audio Suite: RX") == 0 && t.indexOf("Connect") >= 0 })[0];
                if (!win || !win.exists) throw "Could not find iZotope RX Connect AudioSuite window";
                
                win.buttons.whoseTitle.is("Render").first.elementClick({}, "Could not click Render");
                
                /* Uncomment to close when done
                sf.wait({ intervalMs: 100 });
                sf.ui.proTools.waitForNoModals();
                win.windowClose();
                */
                
                1. How is it not working? :) Try to be more descriptive - your code looks fine from a first glance, except of course for the fact that the 3 last lines are in a comment and so won't be run - I'm assuming you put that comment there because it wasn't working?

                  1. It won't close the window. And I didn't know the bottom part was a comment. That was copied from prior code.

                    1. I formatted your code now in your post - this also makes it more visible that the last few lines that are part of the comment are not in fact being executed (they turn grey here, probably green in the editor).

                      Anything between /* and */ in Javascript is considered a multi-line comment and as such won't be executed. Anything after // on the same line is considered a single-line comment and also won't be executed.

                      To fix this, uncomment the lines in question:

                      var shuttleBtn = sf.ui.izotope.mainWindow.children.whoseDescription.endsWith('Main Window').first.children.whoseDescription.is("Shuttle").first;
                      shuttleBtn.elementClick({}, "Could not click Send Back button");
                      
                      sf.wait({ intervalMs: 500 });
                      
                      sf.ui.proTools.appActivateMainWindow({}, "Could not activate Pro Tools");
                      
                      var win = sf.ui.proTools.floatingWindows.filter(function(w){ var t = w.title.value; return t.indexOf("Audio Suite: RX") == 0 && t.indexOf("Connect") >= 0 })[0];
                      if (!win || !win.exists) throw "Could not find iZotope RX Connect AudioSuite window";
                      
                      win.buttons.whoseTitle.is("Render").first.elementClick({}, "Could not click Render");
                      
                      // Uncomment to close when done
                      sf.wait({ intervalMs: 100 });
                      sf.ui.proTools.waitForNoModals();
                      win.windowClose();
                      
                      1. To correctly format your code in the forum, create a line with three back ticks ``` and nothing else, one line before and one line after your script block.
                        I've edited your post so if you edit it you can see how it works.

          2. M
            In reply toMartin_Pavey:
            Martin Pavey @Martin_Pavey
              2019-09-11 22:56:17.354Z

              That works Christian, thanks.
              Now predictably I'm trying to send it back and render the highlighted clip.
              I've got as far as sending it back with command return from RX7, but I can't get the audiosuite plugin
              to render.

              1. MMartin Pavey @Martin_Pavey
                  2019-09-11 23:55:14.149Z

                  I've got it to work with this:

                  sf.keyboard.press({
                  keys: "cmd+return",
                  });
                  sf.wait(1000);
                  sf.ui.proTools.audioSuiteRenderCurrent();

                  But maybe there's a better way?

                  1. This is how it's done in the official Dialog Editing iZotope package (for RX6):

                    
                    var shuttleBtn = sf.ui.izotope.mainWindow.children.whoseDescription.contains('Main Window').first.getFirstWithDescription("Shuttle");
                    shuttleBtn.elementClick();
                    
                    sf.wait({ intervalMs: 500 });
                    
                    sf.ui.proTools.appActivateMainWindow();
                    
                    var win = sf.ui.proTools.getFloatingWindowWithTitleStartingWith("Audio Suite: RX 6 Connect");
                    var renderBtn = win.getFirstWithTitle("Render");
                    renderBtn.elementClick();
                    

                    If you want to check these things out yourself, you can click "View Source" on the command if you have installed the Dialog Editing iZotope package from the store. This was taken from the "iZotope RX - Render & Spot" command.

                    1. I like yours actually, it uses some newer actions. Both solutions I assume work pretty smoothly.

                      1. MMartin Pavey @Martin_Pavey
                          2019-09-12 13:35:17.912Z

                          The RX6 one doesn't work in 7, at least not on my setup.
                          I"m not sure what it does, but it doesn't achieve the send back and render.
                          Anyhow, I'm happy with mine.
                          Thanks

                          1. JJohn Rammelt @John_Rammelt
                              2019-09-15 16:26:01.573Z

                              Hi Martin,

                              I'm also on RX 7 and this is "my"(actually just copied stuff) 'Send back to Pro Tools and Render' script:

                              var shuttleBtn = sf.ui.izotope.mainWindow.getFirstWithDescription('RX7 Main Window').getFirstWithDescription("Shuttle");
                              shuttleBtn.elementClick();
                              
                              sf.wait({ intervalMs: 500 });
                              
                              sf.ui.proTools.appActivateMainWindow();
                              
                              var win = sf.ui.proTools.getFloatingWindowWithTitleStartingWith("Audio Suite: RX 7 Connect");
                              var renderBtn = win.getFirstWithTitle("Render");
                              renderBtn.elementClick();
                              
                              1. MMartin Pavey @Martin_Pavey
                                  2019-09-15 22:57:12.402Z

                                  Thanks John,
                                  I'll give it a try.
                                  I'm pretty happy with the one I made to be honest, it seems to do the job.
                                  Cheers
                                  Martin

                      2. In reply toMartin_Pavey:

                        Clicking +/- on the "Mouse Click Relative to UI Element" action will be fixed in v3.0.1

                        1. MMartin Pavey @Martin_Pavey
                            2019-09-20 18:21:17.253Z

                            That's great!
                            Thanks Christian.