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
  #221  
Old 09-15-2019, 11:48 PM
TrentWilliams TrentWilliams is online now
Member
 
Join Date: Aug 2012
Location: Wellington, New Zealand
Posts: 789
Default Re: Automation AppleScripts for Pro Tools (Mac)

Thanks for all your help with this!

It really makes a difference to my workflow, and I'm hugely appreciative.

Is it possible to add a stop-check in the situation where I'm editing/typing the name of a track?

For instance. Stop/cancel the script if the text enter dialog window is open?
__________________
Pro Tools 2019.6|Ultimate, UAD Apollo 8, UAD Octo+Quad Satellite, UAD Apollo Twin Quad Core, Focusrite 8PreXiMac 27" Late 2013 - 3.5GHz i7 - macOS 10.14.4 • RAM 32GB DDR3, GPU NVidia GTX 780M 4GB
Reply With Quote
  #222  
Old 09-16-2019, 12:06 AM
henningaround henningaround is offline
Member
 
Join Date: Feb 2012
Location: Cologne, Germany
Posts: 64
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by TrentWilliams View Post
Thanks for all your help with this!



It really makes a difference to my workflow, and I'm hugely appreciative.



Is it possible to add a stop-check in the situation where I'm editing/typing the name of a track?



For instance. Stop/cancel the script if the text enter dialog window is open?
Since I use all the script with Keyboard Maestro I can cancle all macros of KM with a shortcut. If you use the scripts directly I don't know how to do this.
Reply With Quote
  #223  
Old 09-16-2019, 02:42 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 945
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by TrentWilliams View Post
Thanks for all your help with this!

It really makes a difference to my workflow, and I'm hugely appreciative.

Is it possible to add a stop-check in the situation where I'm editing/typing the name of a track?

For instance. Stop/cancel the script if the text enter dialog window is open?
You should not stop or cancel the script when you want further actions to be completed by the script after you renamed the track, instead you'd let the script wait for a certain action to be completed, like when having the track rename window open you let the script wait until that window closes/doesn’t exist anymore.

But you should explain your entire workflow in order to get detailed help. What did the script do before the track rename window opens, what should be done when you have entered the new track name and pressed the OK button and so on. The more detailed the question the better the answer. 😉
Reply With Quote
  #224  
Old Yesterday, 01:36 AM
TrentWilliams TrentWilliams is online now
Member
 
Join Date: Aug 2012
Location: Wellington, New Zealand
Posts: 789
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Oliver M View Post
You should not stop or cancel the script when you want further actions to be completed by the script after you renamed the track, instead you'd let the script wait for a certain action to be completed, like when having the track rename window open you let the script wait until that window closes/doesn’t exist anymore.

But you should explain your entire workflow in order to get detailed help. What did the script do before the track rename window opens, what should be done when you have entered the new track name and pressed the OK button and so on. The more detailed the question the better the answer. ��
Hey Oliver, thanks again for all your help.

The script is working fine, it's just when I go to enter text and need numerics it triggers my KM hotkey. (I know I could change my hotkey, but) I was thinking it might be possible to use the script to tell KM to check prior to firing if there is a text box open?

I'm trying to figure out applescripts - *I missed out on learning anything like this in school, a little before my time unfortunately.

Starting with something simple, I've been trying to select the "Clip by Clip" pop up button of the "Processing Input Mode" menu item. But I keep getting a kick back telling me I can't access that item.

Here's what I've got. If you have a minute, I would really appreciate any guidance or insight into what I can do to improve. I installed Xcode to run the Accessibility Inspector because I thought that might help me.


Quote:
tell application "Pro Tools"
activate
tell application "System Events"
tell process "Pro Tools"
click menu item "RX 7 Connect" of menu 1 of menu item "iZotope, Inc." of menu "AudioSuite" of menu bar 1
click pop up button "Clip by Clip" of pop up button "Processing Input Mode"

end tell
end tell
end tell
Basically I just want to be able to run a script with KM that opens RX 7 Connect Audiosuite, and sets it to "Individual Files" and "Clip By Clip".

I thought If I could get it to change to "Clip by Clip" at least I'll be half way there .. but I can't even do that. haha
__________________
Pro Tools 2019.6|Ultimate, UAD Apollo 8, UAD Octo+Quad Satellite, UAD Apollo Twin Quad Core, Focusrite 8PreXiMac 27" Late 2013 - 3.5GHz i7 - macOS 10.14.4 • RAM 32GB DDR3, GPU NVidia GTX 780M 4GB

Last edited by TrentWilliams; Yesterday at 01:53 AM.
Reply With Quote
  #225  
Old Yesterday, 02:07 AM
henningaround henningaround is offline
Member
 
Join Date: Feb 2012
Location: Cologne, Germany
Posts: 64
Default Re: Automation AppleScripts for Pro Tools (Mac)

I do this by setting variables in KM (Plug-In, Preset, Processing Input Mode, Processing Output Mode), giving them to AppleScript and let AppleScript do the clicks with "cliClick" (which was mentioned by Oliver before).

You need some conditions to be checked e.g. is the AudioSuite already opened, which preset and processing modes are set etc.
Reply With Quote
  #226  
Old Yesterday, 04:46 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 945
Default Re: Automation AppleScripts for Pro Tools (Mac)

Trent,

the following reply was prepared offline, before you edited your post and thus is based on the content of your former version.

Quote:
Originally Posted by TrentWilliams
The script is working fine, it's just when I go to enter text and need numerics it triggers my KM hotkey. I know I could change my hotkey, but I was thinking it might be possible to use the script to tell KM to check prior to firing if there is a text box open, or engaged?
This is something to be fixed within KM. I would rather change the hotkey.

Quote:
Originally Posted by TrentWilliams
Starting with something simple, I've been trying to select the "Clip by Clip" pop up button of the "Processing Input Mode" menu item. But I keep getting a kick back telling me I can't access that item.

Here's what I've got. If you have a minute, I would really appreciate any guidance or insight into what I can do to improve. I installed Xcode to run the Accessibility Inspector because I thought that might help me.

Code:
tell application "System Events"
	tell process "Pro Tools"
		set frontmost to true
		if exists (window "AudioSuite") then click (menu item "Processing Input Mode" whose description is "Clip by Clip")
	end tell
end tell
What are you trying to achieve is not possible with plain AppleScript because Pro Tools isn’t scriptable! When you are using AppleScript with Pro Tools you are scripting the user interface of Pro Tools (a.k.a. GUI scripting), not the Pro Tools app itself.

Try this:

Code:
property shortDelay : 0.1

if ptIsRunning() then
	tell application "System Events"
		tell process "Pro Tools"
			set frontmost to true
			tell (1st window whose name contains "Audio Suite")
				try
					-- click button "Processing Input Mode"
					click pop up button "Processing Input Mode"
					delay shortDelay
					key code 126 -- Arrow up key / Selects the "clip by clip" option
					delay shortDelay
					keystroke return
					
				on error e number n
					tell application "Pro Tools" to display alert "An Error Occurred" message e & " (" & n & ")" buttons {"Cancel"} default button 1
				end try
			end tell
		end tell
	end tell
end if

on ptIsRunning()
	return application "Pro Tools" is running
end ptIsRunning
Since this introduces the 6 second delay again (after opening the "Processing Input Mode" menu item) you should use cliclick instead.

Assuming cliclick is installed in usr/local/bin:

Code:
property cliclickCLIPath : missing value
property shortDelay : 0.1

set cliclickCLIPath to "usr/local/bin/cliclick"

if ptIsRunning() then
	tell application "System Events"
		tell process "Pro Tools"
			set frontmost to true
			set asWindow to (1st window whose name contains "Audio Suite")
			try
				tell asWindow
					-- click button "Processing Input Mode"
					tell pop up button "Processing Input Mode"
						set {xPosition, yPosition} to position
						set {xSize, ySize} to size
						my cliClick("c:" & xPosition + (xSize div 2) & "," & yPosition + (ySize div 2))
					end tell
				end tell
				delay shortDelay
				key code 126 -- Arrow up key / Selects the "clip by clip" option
				delay shortDelay
				keystroke return
				
			on error e number n
				tell application "Pro Tools" to display alert "An Error Occurred" message e & " (" & n & ")" buttons {"Cancel"} default button 1
			end try
		end tell
	end tell
end if

on ptIsRunning()
	return application "Pro Tools" is running
end ptIsRunning

on cliClick(coordinate)
	do shell script quoted form of cliclickCLIPath & " -r " & coordinate
end cliClick
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 06:27 PM.


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