Satellite Script Help
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();
- samuel henriques @samuel_henriques
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();
- JJ.R. Chappell @J_R_Chappell
Yes! That did it! Thank you so much for your help!
- RIn reply toJ_R_Chappell⬆:Ricardo Cutz @Ricardo_Cutz
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
samuel henriques @samuel_henriques
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")
- RRicardo Cutz @Ricardo_Cutz
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.. :)
samuel henriques @samuel_henriques
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.
- In reply toRicardo_Cutz⬆:RRicardo Cutz @Ricardo_Cutz
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
- JIn reply toJ_R_Chappell⬆:J.R. Chappell @J_R_Chappell
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();
- RRicardo Cutz @Ricardo_Cutz
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();