No internet connection
  1. Home
  2. How to

Satellite Script Help

By J.R. Chappell @J_R_Chappell
    2021-09-18 15:34:57.484Z

    I am trying to create a button that will chose my satellite machine and then put the satellite online. I created the script as a macro and then converted it to the script below. Almost everything works except once it selects the satellite machine in the second dropdown in the satellite tab I cannot seem to get it to hit enter to close the window. It works fine if I hit enter on the keyboard at that point. I get an error that says AXUI Element Exeption.

    sf.ui.proTools.menuClick({
    menuPath: ["Setup","Peripherals..."],
    });

    sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.radioButtons.whoseTitle.is("Satellites 6 of 8").first.elementClick();

    sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.groups.whoseTitle.is("Administrator").first.popupButtons.whoseTitle.is("none").first.elementWaitFor();

    sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.groups.whoseTitle.is("Administrator").first.popupButtons.allItems[1].elementClick();

    sf.keyboard.press({
    keys: "return, return",
    });

    sf.ui.proTools.mainWindow.groups.whoseTitle.is("Synchronization View Cluster").first.buttons.whoseTitle.is("PT-Mini, Protoolss-Mac-mini.local, 172.110.7.11 28282").first.elementClick();

    • 9 replies
    1. samuel henriques @samuel_henriques
        2021-09-18 16:11:04.774Z

        Hello J_R_Chappell,

        My menus don't show everything the same as yours, so I'll try to help you as much as I can,

        When you choose from a popupMenu, you should use "popupMenuSelect()" method, that will take care of opening choosing and closing the menu.

        I left "none" replace with what is written on the menu option.

        Hope this helps, let me know if you get stuck.

        When you have time, check out this video where Kitch explains how to quote text in the forum:
        How to quote code in the SoundFlow forum.

        sf.ui.proTools.appActivateMainWindow()
        
        sf.ui.proTools.menuClick({
        menuPath: ["Setup","Peripherals..."],
        });
        
        const peripheralsWin = sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.elementWaitFor().element
        
        peripheralsWin.radioButtons.whoseTitle.is("Satellites 6 of 8").first.elementClick();
        
        peripheralsWin.groups.whoseTitle.is("Administrator").first.popupButtons.allItems[1].popupMenuSelect({menuPath:["none"]});///  Here change "none" to the menu option name
        
        peripheralsWin.buttons.whoseTitle.is("OK").first.elementClick();
        
        peripheralsWin.elementWaitFor({waitType:"Disappear"})
        
        sf.ui.proTools.mainWindow.groups.whoseTitle.is("Synchronization View Cluster").first.buttons.whoseTitle.is("PT-Mini, Protoolss-Mac-mini.local, 172.110.7.11 28282").first.elementClick();
        
        1. JJ.R. Chappell @J_R_Chappell
            2021-09-18 16:45:01.117Z

            Yes! That did it! Thank you so much for your help!

          • R
            In reply toJ_R_Chappell:
            Ricardo Cutz @Ricardo_Cutz
              2021-12-08 15:07:01.725Z2021-12-08 15:21:16.009Z

              Hey guys, I found your conversation here, and I guess the last line is my issue, most of the code worked out.
              I'm attaching a picture of my satellite name and and I also do not understand what to do with this line of the code:

              sf.ui.proTools.mainWindow.groups.whoseTitle.is("Synchronization View Cluster").first.buttons.whoseTitle.is("PT-Mini, Protoolss-Mac-mini.local, 172.110.7.11 28282").first.elementClick();
              

              I'm assuming that this part of the script is to "press" the green buttons on the main windonw to enable the satellites it self.

              Thanks for the help

              1. samuel henriques @samuel_henriques
                  2021-12-08 15:17:50.302Z

                  Hello Ricardo,

                  Try this, it should work for System 1

                  /**
                  * @param {string} systemName
                  */
                  function setSatelliteSystem(systemName) {
                      sf.ui.proTools.appActivateMainWindow()
                  
                      sf.ui.proTools.menuClick({
                          menuPath: ["Setup", "Peripherals..."],
                      });
                  
                      const peripheralsWin = sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.elementWaitFor().element
                  
                      peripheralsWin.radioButtons.whoseTitle.is("Satellites 6 of 8").first.elementClick();
                  
                      peripheralsWin.groups.whoseTitle.is("Administrator").first.popupButtons.allItems[1].popupMenuSelect({ menuPath: [systemName] });
                  
                      peripheralsWin.buttons.whoseTitle.is("OK").first.elementClick();
                  
                      peripheralsWin.elementWaitFor({ waitType: "Disappear" })
                  
                  }
                  
                  
                  setSatelliteSystem("PT REC - PT-REC.local")
                  
                  1. RRicardo Cutz @Ricardo_Cutz
                      2021-12-08 15:46:53.778Z

                      thanks @samuel_henriques it worked
                      There is a way to keep the script going and make it click in the green buttons in the picture?
                      thanks!!

                      ps: I know how to do it with relative UI click, but since we are in the script realm.. :)

                      1. samuel henriques @samuel_henriques
                          2021-12-08 16:02:28.627Z

                          cool.
                          I don't have a way to click there. But if you can make it work with a macro action, just copy the action as javascript and paste it at the end of the code I sent.

                          Better than relative UI click would be click ui element.

                          1. In reply toRicardo_Cutz:
                            RRicardo Cutz @Ricardo_Cutz
                              2021-12-08 16:44:31.683Z

                              I have added those lines

                              sf.wait({
                                  intervalMs: 300,
                              });
                              
                              sf.ui.proTools.mainWindow.mouseClickElement({
                                  relativePosition: {"x":1457,"y":44},
                              });
                              
                              sf.wait({
                                  intervalMs: 300,
                              });
                              
                              sf.ui.proTools.mainWindow.mouseClickElement({
                                  relativePosition: {"x":1457,"y":54},
                              });
                              

                              but it clicks only in one of the green buttons. not on booth... what am I doing wrong?

                              thanks
                              best regards

                        • J
                          In reply toJ_R_Chappell:
                          J.R. Chappell @J_R_Chappell
                            2021-12-08 16:28:04.424Z

                            Not sure if this helps but this is how I was able to get it to work.

                            sf.ui.proTools.menuClick({
                            menuPath: ["Setup","Peripherals..."],
                            });

                            sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.radioButtons.whoseTitle.is("Satellites 6 of 8").first.elementClick();

                            sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.groups.whoseTitle.is("Administrator").first.popupButtons.whoseTitle.is("none").first.popupMenuSelect({
                            menuPath: ["Video Sync 5 - JR-MPTCs-Mac-Pro"],
                            });

                            sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.buttons.whoseTitle.is("OK").first.elementClick();

                            sf.wait();

                            sf.ui.proTools.mainWindow.groups.whoseTitle.is("Synchronization View Cluster").first.buttons.whoseTitle.is("PT-Mini, Protoolss-Mac-mini.local, 172.110.7.11 28282").first.elementClick();

                            1. RRicardo Cutz @Ricardo_Cutz
                                2021-12-08 17:37:40.505Z

                                thanks @J_R_Chappell !

                                in the end this is the code working:

                                function setSatelliteSystem(systemName) {
                                    sf.ui.proTools.appActivateMainWindow()
                                
                                    sf.ui.proTools.menuClick({
                                        menuPath: ["Setup", "Peripherals..."],
                                    });
                                
                                    const peripheralsWin = sf.ui.proTools.windows.whoseTitle.is("Peripherals").first.elementWaitFor().element
                                
                                    peripheralsWin.radioButtons.whoseTitle.is("Satellites 6 of 8").first.elementClick();
                                
                                    peripheralsWin.groups.whoseTitle.is("Administrator").first.popupButtons.allItems[1].popupMenuSelect({ menuPath: [systemName] });
                                
                                    peripheralsWin.buttons.whoseTitle.is("OK").first.elementClick();
                                
                                    peripheralsWin.elementWaitFor({ waitType: "Disappear" })
                                
                                }
                                
                                
                                setSatelliteSystem("PT REC - PT-REC.local")
                                
                                
                                sf.ui.proTools.mainWindow.groups.whoseTitle.is("Synchronization View Cluster").first.buttons.whoseTitle.is("PTA, PTA.local, 192.168.1.110 28282").first.elementClick();
                                
                                sf.wait({
                                    intervalMs: 300,
                                });
                                
                                sf.ui.proTools.mainWindow.groups.whoseTitle.is("Synchronization View Cluster").first.buttons.whoseTitle.is("PT REC, PTA.local, 192.168.1.167 28282").first.elementClick();