|
Avid Pro Audio CommunityHow to Join & Post Community Terms of Use Help Us Help YouKnowledge Base Search Community Search Learn & Support |
#211
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
I guess it could work this way:
Code:
-- Define Insert to open here set Insert_to_open to "Insert Assignment A" tell application "System Events" tell process "Pro Tools" set frontmost to true -- Define the correct Insert group. Maybe there is a more elgant way? if (Insert_to_open = "Insert Assignment A") then set Insert_group to "Inserts A-E" else if (Insert_to_open = "Insert Assignment A") then set Insert_group to "Inserts A-E" else if (Insert_to_open = "Insert Assignment A") then set Insert_group to "Inserts A-E" else if (Insert_to_open = "Insert Assignment A") then set Insert_group to "Inserts A-E" else if (Insert_to_open = "Insert Assignment A") then set Insert_group to "Inserts A-E" end if 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 display dialog Insert_to_open click button Insert_to_open of group Insert_group of group formattedString end tell end tell end tell |
#212
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
OH please kill the line:
Code:
display dialog Insert_to_open |
#213
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
Amazing, thank you sooooo much. I really, really appreciate this. I can interchange this script for Inserts/Sends, so this helps a lot. Is there anyway to speed up the script? At the minute its taking a second or two to open the windows.
__________________
Pro Tools 2024.3.0|Perpetual MTRX Studio HDX1 Sync-X S3 Dock Mac Mini 2018 - 3.2GHz i7 6-core macOS 13.6 RAM 64GB DDR4 GPU AMD 6900XT 16GB Monitor LG 32UL950-W |
#214
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
I don't know, I'm really not an Applescript Pro... I think it's been mentioned here, that this is just the way applescript works. Maybe the guys at SoundFlow know a better way ;-)
|
#215
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
This is truly amazing. I wonder how it would work in javascript?
__________________
Pro Tools 2024.3.0|Perpetual MTRX Studio HDX1 Sync-X S3 Dock Mac Mini 2018 - 3.2GHz i7 6-core macOS 13.6 RAM 64GB DDR4 GPU AMD 6900XT 16GB Monitor LG 32UL950-W |
#216
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
|
#217
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Yeah, you're right. That's were one can see that I don't write the code myself but copy and paste stuff together and modify it until it works
|
#218
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
Here's a cleaned up version with error checking. Code:
if ptIsRunning() then -- Define Insert to open here set Insert_to_open to "Insert Assignment A" tell application "System Events" tell process "Pro Tools" set frontmost to true -- Define the correct Insert group if (Insert_to_open = "Insert Assignment A") then set Insert_group to "Inserts A-E" end if tell (1st window whose title contains "Edit: ") try 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 on error e number n if the n is -1719 then tell application "Pro Tools" to display alert "No track was selected." message " " buttons {"Cancel"} default button 1 return else tell application "Pro Tools" to display alert "An Error Occurred" message e & " (" & n & ")" buttons {"Cancel"} default button 1 end if end try if exists (button Insert_to_open of group Insert_group of group formattedString) then click button Insert_to_open of group Insert_group of group formattedString else return end if end tell end tell end tell end if on ptIsRunning() return application "Pro Tools" is running end ptIsRunning |
#219
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Oh thanks a lot. I have to implement that. Scripts get longer and longer...! Are you just using AppleScripts directly mapped to a keystroke? I'm using a combination of Keyboard Maestro and AppleScript right now. In Keyboard Maestro I specify variable or ask for Input (e.g. an AudioSuite Plug-In or an Insert to open) and give it to an Applescript to perform the action.
|
#220
|
|||
|
|||
Re: Automation AppleScripts for Pro Tools (Mac)
Quote:
Sometimes I compile AppleScripts as apps, where it makes sense. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |