script to open protools with a pre-defined engine
I run Protools on a laptop that goes between being connected to a hub and an audio interface in my studio and running remote in various locations. I'd love to have a script that will open protools with a pre-defined engine for when I plug into my hub. Often, it will open with whatever the last used audio engine was so I have to change the engine and restart the session.
Ideally, the script would launch Protools with the same behavior as launching with the 'n' key held down to launch the choose engine dialog and then select my audio interface which I would define in a variable as part of the script.

- Mitch Willard @Mitch_Willard
Hi @Les_Cooper,
You can just adjust the playback engine after launching Pro Tools, instead of writing a function to hold down 'n' on launch.
try this:
function adjustPlaybackEngine() { if (!sf.ui.proTools.isRunning) { function waitForPtLaunch() { while (!sf.ui.proTools.invalidate().hasValidUI) { sf.wait({ intervalMs: 200 }) } for (var i = 0; i < 10; i++) { sf.ui.proTools.waitForNoModals(); } } var playbackEngineArray = ['Universal Audio Thunderbolt', 'MacBook Pro Speakers'] ////Add any additional PLAYBACK ENGINE settings to here. var selectedPaybackEngine = sf.interaction.popupSearch({ title: "Select Playback Engine", items: playbackEngineArray.map(p => ({ name: p, })), columns: [ { name: 'Please Select Playback Engine', key: 'name', width: 80 }, ] }).item.name; sf.app.launch({ path: "/Applications/Pro Tools.app", }); sf.interaction.displayDialog({ prompt: 'Please wait for Pro Tools to Load,\n\nThe Playback Engine "' + selectedPaybackEngine + '" will be selected after launching Pro Tools\n\nThis dialog will disappear after a few seconds.', title: 'PRO TOOLS IS LOADING', giveUpAfterSeconds: 10, }).button waitForPtLaunch(); sf.ui.proTools.menuClick({ menuPath: ['Setup', 'Playback Engine...'] }); let playbackEngineDlg = sf.ui.proTools.windows.whoseTitle.is("Playback Engine").first; playbackEngineDlg.elementWaitFor({ waitType: 'Appear', timeout: 1000, pollingInterval: 50 }); if (playbackEngineDlg.popupButtons.first.value.value != selectedPaybackEngine) playbackEngineDlg.popupButtons.first.popupMenuSelect({ menuPath: [selectedPaybackEngine], }); playbackEngineDlg.buttons.whoseTitle.is("OK").first.elementClick(); playbackEngineDlg.elementWaitFor({ waitType: 'Disappear', timeout: 1000, pollingInterval: 50 }); alert('Your Playback Engine has been set to:\n\n' + selectedPaybackEngine + '.') }; }; adjustPlaybackEngine();
Cheers
Mitch
- LLes Cooper @Les_Cooper
Hey @Mitch_Willard
First off, thank you so much for this. Too cool!
I'm wondering if it would be possible to amend this a bit for some other situations.
I'd like to be able to have a version where it chooses 'Universal Audio Thunderbolt' automatically - without any additional dialogs. This way, I could make a few different versions with different engines to put on a deck.
Thanks again Mitch!
LesMitch Willard @Mitch_Willard
Mitch Willard @Mitch_Willard
Here you go @Les_Cooper,
Just replace
'Universal Audio Thunderbolt'
with whichever Playback Engine setting you'd like to use.function adjustPlaybackEngine(selectedPlaybackEngine) { if (!sf.ui.proTools.isRunning) { function waitForPtLaunch() { while (!sf.ui.proTools.invalidate().hasValidUI) { sf.wait({ intervalMs: 200 }) } for (var i = 0; i < 10; i++) { sf.ui.proTools.waitForNoModals(); } } sf.app.launch({ path: "/Applications/Pro Tools.app", }); sf.interaction.displayDialog({ prompt: `Please wait for Pro Tools to Load,\n\nThe Playback Engine "${selectedPlaybackEngine}" will be selected after launching Pro Tools\n\nThis dialog will disappear after a few seconds.`, title: 'PRO TOOLS IS LOADING', giveUpAfterSeconds: 10, }).button waitForPtLaunch(); sf.ui.proTools.menuClick({ menuPath: ['Setup', 'Playback Engine...'] }); let playbackEngineDlg = sf.ui.proTools.windows.whoseTitle.is("Playback Engine").first; playbackEngineDlg.elementWaitFor({ waitType: 'Appear', timeout: 1000, pollingInterval: 50 }); if (playbackEngineDlg.popupButtons.first.value.value != selectedPlaybackEngine) playbackEngineDlg.popupButtons.first.popupMenuSelect({ menuPath: [selectedPlaybackEngine], }); playbackEngineDlg.buttons.whoseTitle.is("OK").first.elementClick(); playbackEngineDlg.elementWaitFor({ waitType: 'Disappear', timeout: 1000, pollingInterval: 50 }); alert(`Your Playback Engine has been set to:\n\n'${selectedPlaybackEngine}'.`) }; }; adjustPlaybackEngine('Universal Audio Thunderbolt'); ////Replace 'Universal Audio Thuderbolt' with desired PLAYBACK ENGINE setting here.
Thanks
Mitch
- LLes Cooper @Les_Cooper
Too cool!
Thanks again Mitch.
- JIn reply toLes_Cooper⬆:Jonathan Dakers @Jonathan_Dakers
Hi! This script isn't working for me, running Pro Tools 2024.10 in MacOS sequoia. Pro Tools opens, a box pops up saying it will select the right engine, but once Pro Tools is open nothing happens. Any ideas?
edit: Okay now when I opened a project the prompt came up saying the playback engine had been set. Maybe the script is waiting for something that only gets triggered when a project is open?