Avid Pro Audio Community

Avid Pro Audio Community

How to Join & Post  •  Community Terms of Use  •  Help Us Help You

Knowledge Base Search  •  Community Search  •  Learn & Support


Avid Home Page

Go Back   Avid Pro Audio Community > Pro Tools Software > Tips & Tricks

Reply
 
Thread Tools Search this Thread Display Modes
  #181  
Old 01-19-2019, 06:50 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 941
Default Re: Automation AppleScripts for Pro Tools (Mac)

For some reason I cannot post any code to this board, access denied?!?!
Reply With Quote
  #182  
Old 01-19-2019, 06:56 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 941
Default Re: Automation AppleScripts for Pro Tools (Mac)

Here's a download link for the code I intended to post.

AppleScript_for_Johannes.scpt.zip

Install cliclick in /usr/local/bin/.
Reply With Quote
  #183  
Old 01-19-2019, 09:03 AM
its2loud its2loud is offline
Member
 
Join Date: Dec 2014
Location: Los Angles
Posts: 388
Default Re: Automation AppleScripts for Pro Tools (Mac)

this works like a charm. Thanks Oliver!

I've added in the script to type in the preset name. Just replace the line with "your preset name here" with the name of the preset you want to recall.

https://drive.google.com/open?id=1Da...7MlX5Hb99y_mxN

The rest is up to you how you want to implement the script.

keep in mind, to install cliclick in the specified directory you will have to show hidden files and folders in the Finder. The easiest way to do this is open the Finder window and hold Commnd+Shift+. Then drop the cliclick file in the appropriate folder.

cliclick can be downloaded here

https://www.bluem.net/en/projects/cliclick/
Reply With Quote
  #184  
Old 01-19-2019, 12:13 PM
johannes1 johannes1 is offline
Member
 
Join Date: Apr 2013
Location: Germany
Posts: 28
Default Re: Automation AppleScripts for Pro Tools (Mac)

thanks a lot guys. thats it!
i added:
click button "RENDER"
after the first end tell.

wow, now i have to make sure not to move my mouse while executing the macro… otherwise it could do a lot of mess. i wonder if there is way to tell applescript to block mouse or trackpad inputs during the macro¿
Reply With Quote
  #185  
Old 01-19-2019, 12:27 PM
its2loud its2loud is offline
Member
 
Join Date: Dec 2014
Location: Los Angles
Posts: 388
Default Re: Automation AppleScripts for Pro Tools (Mac)

not really sure about that. Considering the script runs in a matter of seconds I wouldn't think it would be a big deal to just take your hand off the mouse when using the shortcut key to run the service/script.

by the way. this script only works if the De-click window is already showing on screen.

I've written a script that will call up the De-click, or any other plugin, if it's not already showing, then execute the remaining commands.

A lot of folks I know use Xkeys for executing these various scripts while editing and such. Makes for a really great workflow. Personally, I've made some user softkeys on the S6 execute these scripts so I don't need Xkeys.
Reply With Quote
  #186  
Old 01-19-2019, 12:48 PM
johannes1 johannes1 is offline
Member
 
Join Date: Apr 2013
Location: Germany
Posts: 28
Default Re: Automation AppleScripts for Pro Tools (Mac)

i see. just tested it with my macbook and its trackpad… will see how it works in my studio. probably just like a dream.

at work the rx declicker is always visible on the second monitor since i use it the whole time. and yes using a xkeys - one key triggering – is great. now i make 3 declick presettings from subtle to hard and map them on 3 keys. ace!

what makes a lot of sense regarding workflow:
i added & " -r " to the shell part at the end of the script which preserves the cursor position on the screen. so you didnt have to "pick up" the cursor from the declick window over and over again.

Last edited by johannes1; 01-19-2019 at 01:05 PM.
Reply With Quote
  #187  
Old 01-21-2019, 05:19 AM
Drew Mazurek's Avatar
Drew Mazurek Drew Mazurek is offline
Moderator
 
Join Date: Oct 2000
Location: Maryland, USA
Posts: 11,526
Default Re: Automation AppleScripts for Pro Tools (Mac)

test

Code:
test
__________________
www.drewmazurek.com

Mixing and Mastering click here to get started.
Reply With Quote
  #188  
Old 01-21-2019, 07:08 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 941
Default Re: Automation AppleScripts for Pro Tools (Mac)

2nd test...

Code:
Thx Drew!
Reply With Quote
  #189  
Old 06-02-2019, 04:48 PM
Kevin Peters Kevin Peters is offline
Member
 
Join Date: Oct 2012
Location: New York City
Posts: 14
Default Re: Automation AppleScripts for Pro Tools (Mac)

Hello,

I'm not sure anyone will be able to help with me, but I've been trying to write a script that will open the pan window of the selected track.

I have successfully done it by looking at the track list group and cycling through all the tracks (which are rows) and finding the first track that is selected. I then take the string from a button that belongs to that row/track and format it to the string I need to actually call on that specific track in the edit window.

Below is the script that works in Pro Tools Ultimate 2018:

Code:
tell application "System Events"
	
	if exists (process "Pro Tools") then
		
		tell process "Pro Tools"
			
			tell (1st window whose title contains "Edit: ")
				
				-- Essentially gets the title of all the tracks in the track list, which is the only place I've found that tells you what is selected.
				set buttonList to title of (1st button of UI element 2 of row of table "Track List" whose title contains "Selected")
				
				repeat with theItem in buttonList
					if theItem contains "Selected" then
						-- Formats the string to what it needs to be to access it's buttons by stripping "Selected. " from the start of it and then correctly formats the type of track it is, which you don't have to do in v2019
						set selectedTrack to text of theItem
						set AppleScript's text item delimiters to "Selected "
						set theTextItems to every text item of selectedTrack
						set AppleScript's text item delimiters to ""
						set selectedTrack to theTextItems as string
						set AppleScript's text item delimiters to " audio track"
						set theTextItems to every text item of selectedTrack
						set AppleScript's text item delimiters to "- Audio Track"
						set selectedTrack to theTextItems as string
						set AppleScript's text item delimiters to " auxiliary track"
						set theTextItems to every text item of selectedTrack
						set AppleScript's text item delimiters to "- Aux Track"
						set selectedTrack to theTextItems as string
						set AppleScript's text item delimiters to " master track"
						set theTextItems to every text item of selectedTrack
						set AppleScript's text item delimiters to "- Master Track"
						set selectedTrack to theTextItems as string
					end if
				end repeat
				
				-- Confirms the button is there before clicking it
				if exists (button "Output Window button" of group "Audio IO" of group selectedTrack) then
					click button "Output Window button" of group "Audio IO" of group selectedTrack
				else
					return
				end if
				
			end tell
		end tell	
	end if
end tell

And since the string was changed a bit this is the code for Pro Tools Ultimate 2019.5:

Code:
tell application "System Events"
	
	if exists (process "Pro Tools") then
		
		tell process "Pro Tools"
			
			tell (1st window whose title contains "Edit: ")
				
				-- Essentially gets the title of all the tracks in the track list, which is the only place I've found that tells you what is selected.
				set buttonList to title of (1st button of UI element 2 of row of table "Track List" whose title contains "Selected")
				
				repeat with theItem in buttonList
					if theItem contains "Selected" then
						-- Formats the string to what it needs to be to access it's buttons by stripping "Selected. " from the start of it
						set selectedTrack to text of theItem
						set AppleScript's text item delimiters to "Selected. "
						set theTextItems to every text item of selectedTrack
						set AppleScript's text item delimiters to ""
						set selectedTrack to theTextItems as string
					end if
				end repeat
				
				-- Confirms the button is there before clicking it
				if exists (button "Output Window button" of group "Audio IO" of group selectedTrack) then
					click button "Output Window button" of group "Audio IO" of group selectedTrack
				else
					return
				end if
				
			end tell
		end tell
	end if
end tell

Now while these scripts work, when a session gets big with a lot of tracks it can take way to long for the script to complete. I believe the bottleneck is that is essentially iterates through all the tracks twice, but I haven't found a more optimized way of doing it.

Soundflow does something similar and it does it much quicker. While I think Soundflow is an incredible program, I need to personally customize my code because I'm constantly trying new things and tweaking.

If no one know the answer to this, hopefully someone will benefit from the above scripts. And thank you to Oliver for doing all the hard work for this thread.
Reply With Quote
  #190  
Old 06-02-2019, 05:46 PM
Kevin Peters Kevin Peters is offline
Member
 
Join Date: Oct 2012
Location: New York City
Posts: 14
Default Re: Automation AppleScripts for Pro Tools (Mac)

To improve upon my post above, I looked through the UI elements of the Track List again, and it turns out that the rows (tracks) in the "Track List" table have a parameter called "Selected" that has a true or false value. Using this new information here is my updated script for 2019.5:

Code:
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
This dramatically increases the speed of the script, although there still is a 1/2 second to 1 second delay in really big sessions with hundreds of tracks. That being said in a small session it's a very short delay. I wonder if there is still a way to speed it up. I got rid of the safety check on the button so save a split second.

Using this script you can change it to open any of the visible inserts, sends, and other buttons on the track.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pro Tools 12 Trim Automation bleu@cheerful.com 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


All times are GMT -7. The time now is 02:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited. Forum Hosted By: URLJet.com