|
Avid Pro Audio CommunityHow to Join & Post • Community Terms of Use • Help Us Help YouKnowledge Base Search • Community Search • Learn & Support |
#271
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Check this out UI Browser or use Apple's Accessibility Inspector, an old app now part of Xcode.
A standalone version can be found somewhere on Apple's Developer servers. |
#272
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
Some years ago -when Avid introduced these changes-, I updated my own personel script so that it reads the close button ID's from a property list. I haven't updated it for a while but it should work up until PT 2019.12 at least. Code:
-- Close Every AudioSuite Window in Pro Tools -- This script closes every open AudioSuite plug-in in Avid Pro Tools. -- Version History: -- v4.0: Due to code changes in Pro Tools 12.8.2 AudioSuite plug-in close buttons no longer use the static index ID 1 but inconsistent IDs. Because of this the ID of an open AS plug-in window's close button will be picked from a property list. -- v3.0: Minimum requirements for this version are macOS 10.12 or higher, Pro Tools 12.7 or higher. -- Got rid of old code for older OS and PT versions. -- Added a check to determine if there is actually an AudioSuite window open (dummy check). -- v2.2: Minor code changes. -- v2.1: Minor code changes. -- v2.0: Turned AppleScript into an AppleScript Bundle. -- v1.0: For personal use only. -- Copyright (c) 2014-2017 Oliver Momm. All rights reserved. property shortDelay : 0.1 property medDelay : 0.3 property longDelay : 0.5 property xtralongDelay : 1 property buttonData : {{name:"C4 Stereo", identifier:11}, ¬ {name:"C6 Stereo", identifier:11}, ¬ {name:"Channel Strip", identifier:11}, ¬ {name:"D-Verb", identifier:12}, ¬ {name:"DC Offset Removal", identifier:9}, ¬ {name:"DeEsser Stereo", identifier:11}, ¬ {name:"Devil-Loc Deluxe", identifier:11}, ¬ {name:"Doubler2 Stereo", identifier:11}, ¬ {name:"Doubler4 Stereo", identifier:11}, ¬ {name:"Duplicate", identifier:10}, ¬ {name:"Elixir v3 - 1 Stage", identifier:11}, ¬ {name:"Elixir v3", identifier:11}, ¬ {name:"EQ3 1-Band", identifier:11}, ¬ {name:"EQ3 7-Band", identifier:11}, ¬ {name:"Gain", identifier:7}, ¬ {name:"GRM BandPass", identifier:11}, ¬ {name:"GRM CombFilter", identifier:11}, ¬ {name:"GRM Contrast", identifier:11}, ¬ {name:"GRM Delays", identifier:12}, ¬ {name:"GRM Doppler", identifier:11}, ¬ {name:"GRM Equalize", identifier:11}, ¬ {name:"GRM Freeze", identifier:11}, ¬ {name:"GRM PitchAccum", identifier:11}, ¬ {name:"GRM Reson", identifier:11}, ¬ {name:"GRM Shift", identifier:11}, ¬ {name:"GRM Shuffling", identifier:12}, ¬ {name:"GRM Warp", identifier:11}, ¬ {name:"HoRNetSongKeyMK2", identifier:11}, ¬ {name:"Invert", identifier:10}, ¬ {name:"IRCAM Tools - T.R.A.X. CS v3", identifier:11}, ¬ {name:"IRCAM Tools - T.R.A.X. SF v3", identifier:11}, ¬ {name:"IRCAM Tools - T.R.A.X. Tr. v3", identifier:11}, ¬ {name:"iZotope DDLY", identifier:12}, ¬ {name:"iZotope RX 5 Connect", identifier:10}, ¬ {name:"iZotope RX 5 De-click", identifier:11}, ¬ {name:"iZotope RX 5 De-clip", identifier:11}, ¬ {name:"iZotope RX 5 De-crackle", identifier:11}, ¬ {name:"iZotope RX 5 De-hum", identifier:11}, ¬ {name:"iZotope RX 5 De-noise", identifier:11}, ¬ {name:"iZotope RX 5 De-reverb", identifier:11}, ¬ {name:"iZotope RX 5 Dialogue De-noise", identifier:11}, ¬ {name:"L1+ Ultramaximizer Stereo", identifier:11}, ¬ {name:"L2 Stereo", identifier:11}, ¬ {name:"Lo-Fi", identifier:11}, ¬ {name:"LoAir Stereo", identifier:11}, ¬ {name:"Massenburg Design Works EQ5 3 Bands", identifier:11}, ¬ {name:"Massenburg Design Works EQ5 5 Bands", identifier:11}, ¬ {name:"MetaFilter Stereo", identifier:12}, ¬ {name:"MetaFlanger Stereo", identifier:11}, ¬ {name:"Mod Delay III", identifier:12}, ¬ {name:"MondoMod Stereo", identifier:11}, ¬ {name:"Normalize", identifier:5}, ¬ {name:"Oxford Dynamics Full", identifier:11}, ¬ {name:"Oxford Dynamics Surround", identifier:11}, ¬ {name:"Oxford Envolution", identifier:11}, ¬ {name:"Oxford EQ+Filters", identifier:11}, ¬ {name:"Oxford Inflator", identifier:11}, ¬ {name:"Oxford Limiter", identifier:11}, ¬ {name:"Oxford Reverb", identifier:12}, ¬ {name:"Oxford SuprEsser HighRes", identifier:11}, ¬ {name:"Oxford SuprEsser LowLatency", identifier:11}, ¬ {name:"Oxford SuprEsser", identifier:11}, ¬ {name:"Oxford TransMod", identifier:11}, ¬ {name:"Pitch 'n Time Pro", identifier:12}, ¬ {name:"Pitch II", identifier:11}, ¬ {name:"Pitch Shift Legacy", identifier:11}, ¬ {name:"Pro Limiter Loudness Analyzer", identifier:11}, ¬ {name:"Q10 Stereo", identifier:11}, ¬ {name:"Recti-Fi", identifier:11}, ¬ {name:"Reverse", identifier:10}, ¬ {name:"S1 Imager Stereo", identifier:11}, ¬ {name:"S1 MS Matrix Stereo", identifier:11}, ¬ {name:"S1 Shuffler Stereo", identifier:11}, ¬ {name:"SA2 Dialog Processor", identifier:11}, ¬ {name:"Sci-Fi", identifier:11}, ¬ {name:"Signal Generator", identifier:11}, ¬ {name:"Space", identifier:12}, ¬ {name:"SuperTap 6-Taps Stereo", identifier:12}, ¬ {name:"Time Compression Expansion", identifier:9}, ¬ {name:"Time Shift", identifier:11}, ¬ {name:"Vari-Fi", identifier:10}} set finderIconPath to (path to library folder from system domain as text) & "CoreServices:Finder.app:Contents:Resources:Finder.icns" set ptIconPath to (path to applications folder as text) & "Pro Tools.app:Contents:Resources:ProTools.icns" if not osVersionCheck("10.12") then -- Display error message try activate application "Pro Tools" tell application "Pro Tools" to display dialog return & "This script requires macOS 10.12 or higher." & return with icon file finderIconPath buttons {"Cancel"} default button "Cancel" on error errorMessage number errorNumber if errorNumber = -1712 then -- If script times out return true else if errorNumber = -128 then -- If user cancels script return true else tell application "Pro Tools" to display alert "Error: " & the errorNumber & ": " message the errorMessage buttons {"OK"} default button "OK" end if end try activate application "Pro Tools" else try if ptVersionCheck("12.8.2") then activate application "Pro Tools" tell application "System Events" tell process "Pro Tools" -- Check if an AudioSuite plug-in window is open if not (exists (every window whose name contains "Audio Suite")) then -- Do nothing else set asWindows to (get windows whose name contains "Audio Suite") repeat with aWindow in asWindows set windowName to name of aWindow set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ": "} set plugInName to text item 2 of windowName set AppleScript's text item delimiters to TID set buttonID to my identifierFor(plugInName) if buttonID is -1 then -- Display error message try tell application "Pro Tools" activate display alert "Plug-in " & plugInName & " not supported" message "Please, contact the author of this script." buttons {"OK"} default button "OK" end tell on error errorMessage number errorNumber if errorNumber = -1712 then -- If script times out return true end if end try else tell aWindow to click button buttonID end if end repeat end if end tell end tell else -- Display error message try tell application "Pro Tools" activate display alert "Incompatible Pro Tools Version" message "This action requires Pro Tools 12.8.2 or higher." buttons {"Cancel"} default button "Cancel" end tell on error errorMessage number errorNumber if errorNumber = -1712 then -- If script times out return true end if end try end if -- ptVersionCheck end try end if -- osVersionCheck on ptVersionCheck(referenceVersion) set proToolsVersion to version of application "Pro Tools" considering numeric strings return (proToolsVersion as text) is greater than or equal to referenceVersion end considering end ptVersionCheck on osVersionCheck(referenceVersion) set osVersion to system version of (system info) considering numeric strings return (osVersion as text) is greater than or equal to referenceVersion end considering end osVersionCheck on identifierFor(buttonName) repeat with aRecord in buttonData if aRecord's name is buttonName then return aRecord's identifier end repeat return -1 end identifierFor Download compiled script. |
#273
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
hi
i've found a solution for close any open audio suite Code:
tell application "System Events" tell application process "Pro Tools" set frontmost to true try set plug to first window whose title contains "Audio Suite:" on error display alert " No Audio suite open" return end try set f to get subrole of button of plug end tell end tell set closeBtnPos to getPositionOfItemInList("AXCloseButton", f) tell application "System Events" click button closeBtnPos of plug end tell on getPositionOfItemInList(theItem, theList) repeat with a from 1 to count of theList if item a of theList is theItem then return a end repeat return 0 end getPositionOfItemInList enjoy Last edited by oudi; 06-27-2020 at 09:58 AM. |
#274
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
|
#275
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
How are you?
I am very new to this and I am somewhat dizzy. I'm trying to use the master keyboard to be able to select a channel and activate or deactivate a specific insert number (eg Bypass insert 7). It's possible? And is it possible having pro tools in Spanish and with the mixer view always in front? Thanks!! |
#276
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
yes, this can be done. See henningaround's post #211 on page 22 and post #218. Instead of clicking the button Insert_to_open you should control-click it with Cliclick. Unfortunately I don't speak Spanish. Please, have a look at UI Browser and check if it supports Spanish GUI elements in Pro Tools. |
#277
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Hello to all,
I am face to a problem with a script I am using on Protools 2020.3 that works perfectly but for a reason does not work with Protools 2018.3. The script is made to open the output window of the selected track. It goes as follows : tell application "System Events" if exists (process "Pro Tools") then tell process "Pro Tools" tell (1st window whose title contains "Edit: ") set selectedTrack to title of button of UI element 2 of (1st row of table "Track List" whose selected is true) set formattedString to text of selectedTrack as string set AppleScript's text item delimiters to "Selected. " set theTextItems to every text item of formattedString set AppleScript's text item delimiters to "" set formattedString to theTextItems as string click button "Output Window button" of group "Audio IO" of group formattedString end tell end tell end if end tell On the machine with Protools 2018.3, it does not work and I have this message : Error Number: -1728 System Events got an error: Can’t get group "Selected Audio 2 audio track" of window 1 of process "Pro Tools" whose title contains "Edit: ". Anyone could help? Many thanks in advance, Simon |
#278
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Thank you very much, this is very helpful.
Following for future updates |
#279
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
|
#280
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pro Tools 12 Trim Automation | [email protected] | Pro Tools 12 | 2 | 08-16-2015 04:25 AM |
Pro Tools 11.2.1 Automation Bug?! | Gneal550 | Pro Tools 11 | 1 | 11-22-2014 01:15 PM |
GRM tools automation bug? | D'Animation | Pro Tools TDM Systems (Mac) | 6 | 10-08-2014 08:21 AM |
scripting Pro Tools; automation | Bermaster | 003, Mbox 2, Digi 002, original Mbox, Digi 001 (Mac) | 12 | 10-01-2004 12:38 PM |
AppleScripts and other Macros for PT | Bergeron | Tips & Tricks | 1 | 11-15-1999 06:55 PM |