Pro Tools | AppleScript

Macros and Shortcuts for Pro Tools using AppleScript

Since EuControl dose miss out on some features (you can find out more here), we are helping our selfs by using AppleScript with a little help of Automator.
(Since we are using AppleScript, this will only work on Mac)

Ill be showing one detailed example with a complete walkthrough and some use cases.

AppleScript

This Script as shown in the video above, will open the “iZotope RX 5 De-crackle” AudioSuite window if not already open (this is represented by the if/else Routine), and hit the “Render”-Button.

Note: The AudioSweet Plugin will open with its default values. So make sure you set your go-to- preset to the factory default setting.

tell application "System Events"
tell process "Pro Tools"
set frontmost to true
if exists (window "Audio Suite: iZotope RX 5 De-crackle") then click button "Render" of window "Audio Suite: iZotope RX 5 De-crackle"
else
click menu item "iZotope RX 5 De-crackle" of menu of menu item "iZotope, Inc." of menu "AudioSuite" of menu bar 1 click button "Render" of window "Audio Suite: iZotope RX 5 De-crackle"
end if
end tell
end tell

Automator

To run the AppleScript will be using the macOS/OS X build in Automator App which is capable to create and run Services.
Creating a Service, open the Automator App, choose “Service” as your wanted type of document. Set the “Service receives” to “no input” in the dropdown menu (will be using a shortcut) and set the “in” to “Pro Tools” so the service will only be visible in the Pro Tools Applications.

Add the actions “Run AppleScript” and enter the Script to the Action. All should look now like this:

Save it and give it a name.

 

Accessibility Control

To let Automator and Pro Tools control other applications we have to go to the

System Preferences / Security & Privacy / Privacy / Accessibility /

and add the Automator App to the “Allow the apps below to control your computer.” and check the checkbox.

Shortcut

Using a keyboard shortcut to run the Script will have to go to

System Preferences / Keyboard / Shortcuts / Services /

here will be able to see our newly created service and give it a shortcut
Note: Use only shortcut which are not used by Pro Tools. I Recommend using the F13 to F19 Keys.

Pro Tools | AppleScript

As you can see using AppleScript and Automator to create shortcuts and even macros for Pro Tools which are missing out is a helpful and powerful tool (especially for mouse only commands).

Some other use cases:

If you’r looking out further into creating your own AppleScript the “Accessibility Inspector“ which comes with Xcode will be a helpful tool. It allows to inspect UI elements.

Note: The shown example are all for Pro Tools 11 and above. Pro Tools 10 is using Number instead of Names for the Buttons.

BTW: featured as a Community Tip at Pro Tools Expert 🙂

If you have any questions feel free to leave a comment.

16 Replies to “Pro Tools | AppleScript”

  1. Hallo Richard,
    vielen Dank für diesen unglaublich hilfreiche Tip und die gute Anleitung! Ich habe mir analog dazu einige Shortcuts basteln können. Das wird mir hochgerechnet einige Wochen Arbeit und mehrere Kilometer Mausbewegung ersparen. Eine Frage hätte ich noch. Hast Du irgendeinen Weg gefunden, die Ausführung des Scripts zu beschleunigen? Im Moment dauert es bei mir ca. anderthalb Sekunden, bis der Befehl ausgeführt wird.
    Herzliche Grüße, und noch mal vielen Dank!
    Karl Atteln

    1. Hallo Karl,

      ich kann leider zu den anderthalb Sekunden Verzögerungen wenig sagen.
      An den von mir getesteten Systeme treten kaum merkbare Latenzen auf (Die Videos zeigen das ausführen der Befehle in echt-zeit).
      Einflussfaktoren können natürlich OS Version, die Performance des Systems und natürlich die Auslastung des Systems darstellen.

      Gruß Richard

  2. Hello, very interesting. I’m not very good in script writing. Could you please tell me how to write the script for rx 6 connect send/render? I’m using it a lot in post production and it would be more than useful. Cheers. Michov

  3. Hi Michov,

    it should basically look like this:

    tell application “System Events”
    tell process “Pro Tools”
    set frontmost to true
    if exists (window “Audio Suite: iZotope RX 6 Connect”) then
    click button “Analyze” of window “Audio Suite: iZotope RX 6 Connect”
    else
    click menu item “iZotope RX 6 Connect” of menu of menu item “iZotope, Inc.” of menu “AudioSuite” of menu bar 1
    click button “Analyze” of window “Audio Suite: iZotope RX 6 Connect”
    end if
    end tell
    end tell

    Unfortunately RX 5 Audio Editor is blocking OS X Service (can’t tell for RX 6 Audio Editor).
    Otherwise it would be possible to make the Send&Returen-Routin a two click workflow.
    So far you have to hit cmd+return in RX Audio Editor to send back to Pro Tools, here you can use the same script insted of “Analyze” use “Render”.

    Cheers
    Richard

    1. Thanks a lot Richard! It’s finally working. You can’t imagine how much time i’m gonna save thanks to you.
      Keep on like this
      Cheers
      Michov

  4. I’ve been trying my very best, but i just caant write a code, to make a shortcut for Write Automation to Selection from the Automation Panel.. That would really up my workflow if that was possible? Thanks very much for this tutorial btw!

    1. Hi Emil,

      sorry for the late reply had some busy weeks.
      For the script, this should work:

      tell application “Pro Tools”
      tell application “System Events”
      click button 11 of window “” of application process “Pro Tools”
      end tell
      end tell

      You can try the “Inspector”-App from the Xcode Bundle, it can show you the Name or Nr. of UI-Elemtents like Buttons.

      Cheers
      Richard

  5. Can you tell me how to write one for the “iZotope RX 6 De-click” render button?
    I’m running PT 12 Version 2018.3.0 on OS Sierra

    Thank you!
    Louie

  6. Hey Louie,

    The following should work to click the render button for any AudioSuite plugin window:

    tell application “System Events”
    tell process “Pro Tools”
    if exists (1st window whose name contains “AudioSuite”) then
    tell (1st window whose name contains “AudioSuite”)
    click button “Render”
    end tell
    else if exists (1st window whose name contains “Audio Suite”) then
    tell (1st window whose name contains “Audio Suite”)
    click button “Render”
    end tell
    else
    display dialog “Error: Window Not Found. Please open and AudioSuite window and try again”
    end if
    activate
    end tell
    end tell

    Hope this helps

    Jon

  7. Hello
    Thank you for your great value post !!!
    It seems that i can’t write a code either… What I would need is this :
    Command-click on the preview button in the automation panel.
    Can you write it for me please ?
    Thank you.

  8. Hey, this is truly amazing and I’ve tried to achieve this on Sierra with PT 2018.7 but can’t get past the AppleScript stage.
    It keeps coming up this error:
    Syntax Error
    Expected “end” or “end tell” but found “else”.
    Any ideas what I’m doing wrong?

  9. Hi
    im really greatful for your post!
    I´ve made my scripts for audiosuite: invert, reverse, send to RX, RX De-click, RX Voice Denoise, MSED. Im working with PT11, at the beginning i couldn´t get it works but i only had to change “render” for “process” and everything works well for some days until I got an error in automator, and now always says: “System Events got an error: Automator is not allowed assistive access”. I don´t know why I added automator to the accessibility panel before. Even if I remove and add again automator to accessibility panel the scripts works for a one or two time and again got a message: System Events got an error: Automator is not allowed assistive access.
    Do you know why this happen and how can i fix it? Could you help me?

  10. Hi
    Im greatful for your post!
    I´ve done my scripts for audio suite: reverse, invert, send to RX, RX de click, RX Voice De noise. At the beginning I got an error in the script, I had to change “render” for “process” and everything works well for some days until I got an error with automator and now always got the error: System Events got an error: Automator is not allowed assistive access. Even removing and adding many times the automator to accessibility panel it works one or two time and the error continue.
    Do you know why this happen, how can i fix it?
    I will appreciate your help

  11. Hi Jon, I’ve attempted a simple code to reverse audio in protools. However when I try to run it, i get the error “System Events got an error: Can’t get button \”render\” of window \”Audio Suite: Reverse\” of process \”Pro Tools\”.” number -1728 from button “render” of window “Audio Suite: Reverse” of process “Pro Tools”

    Here is the code.. can you say what i am doing wrong?

    tell application “System Events”
    tell process “Pro Tools”
    set frontmost to true
    if exists (window “AudioSuite: Reverse”) then
    click button “Render” of window “Audio Suite: Reverse”
    else
    click menu item “Reverse” of menu of menu item “Other” of menu “AudioSuite” of menu bar 1
    click button “render” of window “Audio Suite: Reverse”
    end if
    end tell
    end tell

  12. Hi there, I am trying to implement the RX Connect send and receive scripts for PT 2019.10 and RX7.

    I always get this error:
    Expected “end” or “end tell” but found “else”.
    Any clues as to why this happens? Any help appreciated!

    Here is the script:
    tell application “System Events”
    tell process “Pro Tools”
    set frontmost to true
    if exists (window “Audio Suite: iZotope RX 7 Connect”) then click button “Send” of window “Audio Suite: iZotope RX 7 Connect”
    else
    click menu item “iZotope RX 7 Connect” of menu of menu item “iZotope, Inc.” of menu “AudioSuite” of menu bar 1 click button “Send” of window “Audio Suite: iZotope RX 7 Connect”
    end if
    end tell
    end tell

  13. Hi!
    Thank you very much for the tips!
    Unfortunately it does’n work for me .. Like Luc I tried to make a shortcut for the preview Button and In ProTools it says “The action “Run AppleScript” encountered an error.”

    I think I followed correctly the step.
    I enabled the applications on the Accessibility menu and as I am in Protools 10, I wrote with Automator a scrip using button 11 to try first (Write Automation to Selection from the Automation Panel)
    Can you help me?

    Here the scrip I wrote :

    tell application “Pro Tools”
    tell application “System Events”
    click button 11 of window “” of application process “Pro Tools”
    end tell
    end tell

    Thank you very much
    (I tried to install Xcode for the inspector but the component installation failed..)

Leave a Reply to Louie Cancel reply

Your email address will not be published.