By Mike Avenaim @Mike_Avenaim
@Kitch Hey man,
How does this code look? Im essentially wanting it to open a preset I/O setting in case mine get overwritten by another session from a different source. This actually happens frequently to me.
I havent added the last step of pushing "OK" because im still testing it and dont want to accidentally commit the I/O settings, haha.
// Activate Pro Tools Window
sf.ui.proTools.appActivateMainWindow();
// Select I/O Window from Menu
sf.ui.proTools.menuClick({
menuPath: ["Setup", "I/O..."],
});
// Select "Bus" Tab
sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first.radioButtons.whoseTitle.is('Bus 3 of 6').first.elementClick();
// Import Settings
sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first.buttons.whoseTitle.is('Import Settings...').first.elementClick();
sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first.elementWaitFor();
// Select desired I/O preset
sf.keyboard.press({
keys: "slash",
});
sf.keyboard.press({
keys: "backspace",
});
//Change name of preset here
sf.keyboard.type({
text: "Temp I_O.pio",
});
sf.keyboard.press({
keys: "return",
});
//Open preset
sf.keyboard.press({
keys: "return",
});
sf.ui.proTools.windows.whoseTitle.is('').first.elementWaitFor();
// Delete unused buses prompt
sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is('No').first.elementClick();
Linked from:
- In reply toMike_Avenaim⬆:Kitch Membery @Kitch2020-12-23 01:55:55.024Z
This should do the job mate!
You got a great start on it!
Here is an update!
Be sure to un-comment the
ioWin.buttons.whoseTitle.is('OK').first.elementClick();
line to ok the changes.And set your preset name in the
importBusSettings("Temp I_O.pio");
line.function importBusSettings(presetName) { //Activate Pro Tools Window sf.ui.proTools.appActivateMainWindow(); //Open I/O Window sf.ui.proTools.menuClick({ menuPath: ["Setup", "I/O..."], }); const ioWin = sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first; //Select "Bus" Tab ioWin.radioButtons.whoseTitle.startsWith('Bus').first.elementClick(); //Wait for Tab ("Active Busses" text is unique to the bus tab) ioWin.children.whoseRole.is("AXStaticText").whoseValue.is('Active Busses:').first.elementWaitFor(); //Click 'Import Settings...' ioWin.buttons.whoseTitle.is('Import Settings...').first.elementClick(); const openWin = sf.ui.proTools.windows.whoseTitle.is('Open').first; //Wait for 'Open' window openWin.elementWaitFor(); //Open 'go' sheet sf.keyboard.type({ text: '/' }); //Wait for Open window openWin.sheets.first.elementWaitFor(); //Set preset name openWin.sheets.first.comboBoxes.first.value.value = presetName; //Click Go openWin.sheets.first.buttons.whoseTitle.is('Go').first.elementClick(); //Click Open openWin.buttons.whoseTitle.is('Open').first.elementClick(); //Wait for Dialog window sf.ui.proTools.confirmationDialog.elementWaitFor(); //Delete unused buses prompt sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is('No').first.elementClick(); //Click OK //ioWin.buttons.whoseTitle.is('OK').first.elementClick(); } importBusSettings("Temp I_O.pio");
- MMike Avenaim @Mike_Avenaim
Love this @Kitch really nice way to clean it all up with the function and const
Kitch Membery @Kitch2020-12-23 02:06:40.888Z
Rock on Brother!