View Single Post
  #211  
Old 09-06-2019, 03:25 AM
henningaround henningaround is offline
Member
 
Join Date: Feb 2012
Location: Cologne, Germany
Posts: 128
Default 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
The way to get the selected track into the script was posted here before :) You should be able to use this in a similar way for Solo, Mute, etc.
Reply With Quote