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
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #81  
Old 03-10-2016, 06:46 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 1,108
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by boomish69 View Post
Thanks for the scripts Oliver, Do you know anyway I can get it to work for 11 & 12 on the same system? If I try and add either to the security window it will only add one "Pro Tools"

It seems it only likes Pro Tools 12, I thought at first it was a naming thing as I renamed 11 "Pro Tools 11 then 12 is called "Pro Tools" but I rename them the other way around the security window shows Pro Tools 12. I then tried removing it and adding only 11 this did get it to work in 11 but sometimes the commands stop working and I get an error "system events. Can't get window "new tracks" of process "Pro Tools". (-1728)

Any solution idea's? apart from run 12 :)

2 reasons, I work a lot with others that only run 11 and I have yet to get 12 to run very stable.
Gotcha, co-install is something a lot of users want/use. Hmmm, I have to check whats going on. Actually the scripts shouldn’t differ between the two PT versions as long as its version 11.1 or higher for PT 11.
Reply With Quote
  #82  
Old 03-10-2016, 02:28 PM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 1,108
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Marco Bernardo View Post
Here is a zip with the xcode project, just need to be compiled.
Thats an interesting project, Marco.
Unfortunately the script (app) does weird things on my system so I take it that it wasn't created for the public but personal use?!
Reply With Quote
  #83  
Old 03-10-2016, 02:30 PM
Marco Bernardo's Avatar
Marco Bernardo Marco Bernardo is offline
Member
 
Join Date: Jan 2007
Location: Lisboa, Portugal
Posts: 787
Default Re: Automation AppleScripts for Pro Tools (Mac)

I've forgot again to mention, that track list, clip list and all floating windows should be closed, and the Edit window and mix maximised.

I need to write a read me file eheheh.

As you teach me, we can't get to know some settings if they are enable or disable, example, some radio buttons, and in this case the track list and clips list are showed or hidden. At least I didn't discover how to do it.

I will update the project with some guide lines in a few minutes.

Here is the new project .. download here
__________________
Marco Bernardo

Dialog Editor, Sound Designer, Re-Recording mixer

nMacPro 6Core/D500/512GB/64Gb ram | PT HD 12 HDN Thunderbolt | HD OMNI | Avid Artist Mix | Novation Impulse 25 | Waves Mercury Native | Audioease All In Bundle | SoundToys | McDSP Classic Pack | DUY Overpack | Arturia Beatstep Pro

Last edited by Marco Bernardo; 03-10-2016 at 02:54 PM.
Reply With Quote
  #84  
Old 03-11-2016, 11:33 AM
Marco Bernardo's Avatar
Marco Bernardo Marco Bernardo is offline
Member
 
Join Date: Jan 2007
Location: Lisboa, Portugal
Posts: 787
Default Re: Automation AppleScripts for Pro Tools (Mac)

Here is a full video of the full "app" and all it does.

https://www.youtube.com/watch?v=e_EVbh4v4F8
__________________
Marco Bernardo

Dialog Editor, Sound Designer, Re-Recording mixer

nMacPro 6Core/D500/512GB/64Gb ram | PT HD 12 HDN Thunderbolt | HD OMNI | Avid Artist Mix | Novation Impulse 25 | Waves Mercury Native | Audioease All In Bundle | SoundToys | McDSP Classic Pack | DUY Overpack | Arturia Beatstep Pro
Reply With Quote
  #85  
Old 03-12-2016, 10:18 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 1,108
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Marco Bernardo View Post
I've forgot again to mention, that track list, clip list and all floating windows should be closed, and the Edit window and mix maximised.

I need to write a read me file eheheh. ...
I know how it is, Marco.
When creating scripts for personal use it is not necessary to think about things that could go wrong because the script creator knows what to avoid.
Creating versions for public usage is a totally different ballgame as all kinds of checks (if/then/else etc. etc.) should be implemented, checks that sometimes are very hard or even impossible to achieve. ;-)

I am curious, why have you opted for a click by position with cliclick for checkboxes like "Audio Files" and "Convert to Specified Format"?

click checkbox "Audio Files"

and

click checkbox "Convert to Specified Format"

should have worked just fine, without cliclick.

And another little thing.
Since you have created the variable "sessioname" already, you can pass this over to the text field of the Save window, like that:

tell window "Save"
set value of text field 1 to sessioname
end tell

So no need for all this key code stuff. ;-)
Reply With Quote
  #86  
Old 03-12-2016, 03:57 PM
Marco Bernardo's Avatar
Marco Bernardo Marco Bernardo is offline
Member
 
Join Date: Jan 2007
Location: Lisboa, Portugal
Posts: 787
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Oliver M View Post
I know how it is, Marco.
When creating scripts for personal use it is not necessary to think about things that could go wrong because the script creator knows what to avoid.
Creating versions for public usage is a totally different ballgame as all kinds of checks (if/then/else etc. etc.) should be implemented, checks that sometimes are very hard or even impossible to achieve. ;-)

I am curious, why have you opted for a click by position with cliclick for checkboxes like "Audio Files" and "Convert to Specified Format"?

click checkbox "Audio Files"

and

click checkbox "Convert to Specified Format"

should have worked just fine, without cliclick.

And another little thing.
Since you have created the variable "sessioname" already, you can pass this over to the text field of the Save window, like that:

tell window "Save"
set value of text field 1 to sessioname
end tell

So no need for all this key code stuff. ;-)
I think I've just got excited with cliclilck and used for everything... In that case it was not need you're right, there's no 6 seconds delay (the "bug" in El Capitain).

I'm trying to figure out what to do with this... I get what it does, but still not get where I can use it.. :/

Code:
tell window "Save"
set value of text field 1 to sessioname
end tell


One thing that I've managed to do is pass at least the error of people let the track list open and the script stop.

Code:
try
click button "Track List Show/Hide"
tell button "Track List pop-up" --perform action "AXPress" of button 5
set {xPosition, yPosition} to position
set {xSize, ySize} to size
my cliClick("c:" & xPosition + (xSize div 2) & "," & yPosition + (ySize div 2))
end tell
on error
click button "Track List Show/Hide"
end try
__________________
Marco Bernardo

Dialog Editor, Sound Designer, Re-Recording mixer

nMacPro 6Core/D500/512GB/64Gb ram | PT HD 12 HDN Thunderbolt | HD OMNI | Avid Artist Mix | Novation Impulse 25 | Waves Mercury Native | Audioease All In Bundle | SoundToys | McDSP Classic Pack | DUY Overpack | Arturia Beatstep Pro
Reply With Quote
  #87  
Old 03-12-2016, 04:20 PM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 1,108
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Marco Bernardo View Post

I'm trying to figure out what to do with this... I get what it does, but still not get where I can use it.. :/

Code:
tell window "Save"
set value of text field 1 to sessioname
end tell
Assuming your Save Session Copy window is opened:

Code:
set sessionName to "This Is A Test"

activate application "Pro Tools"
tell application "System Events"
	tell process "Pro Tools"
		tell window "Save Session Copy"
			click checkbox "Audio Files"
			click checkbox "Convert to Specified Format"
			click button "OK"
		end tell
		repeat until exists window "Save"
			delay 0.1
		end repeat
		tell window "Save"
			set value of text field 1 to sessionName
			delay 0.1
		end tell		
	end tell
end tell
Reply With Quote
  #88  
Old 03-12-2016, 04:25 PM
Marco Bernardo's Avatar
Marco Bernardo Marco Bernardo is offline
Member
 
Join Date: Jan 2007
Location: Lisboa, Portugal
Posts: 787
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Oliver M View Post
Assuming your Save Session Copy window is opened:

Code:
set sessionName to "This Is A Test"

activate application "Pro Tools"
tell application "System Events"
	tell process "Pro Tools"
		tell window "Save Session Copy"
			click checkbox "Audio Files"
			click checkbox "Convert to Specified Format"
			click button "OK"
		end tell
		repeat until exists window "Save"
			delay 0.1
		end repeat
		tell window "Save"
			set value of text field 1 to sessionName
			delay 0.1
		end tell		
	end tell
end tell

NICEEEEEEEEEE

I can use this for all the other windows too, Bounce, Export session info as text. NICE!!!!

Thank you always learning that's awesome.

Is there a better way to get errors? I used the try.

I've used this:

Code:
try
 click button "Track List Show/Hide"
on error
display dialog "Please close Track List"
end try
by the way did you see the video this is the all script, I need to do this more than 100 times to finish the work I need to do.
__________________
Marco Bernardo

Dialog Editor, Sound Designer, Re-Recording mixer

nMacPro 6Core/D500/512GB/64Gb ram | PT HD 12 HDN Thunderbolt | HD OMNI | Avid Artist Mix | Novation Impulse 25 | Waves Mercury Native | Audioease All In Bundle | SoundToys | McDSP Classic Pack | DUY Overpack | Arturia Beatstep Pro

Last edited by Marco Bernardo; 03-12-2016 at 04:54 PM.
Reply With Quote
  #89  
Old 03-15-2016, 04:44 AM
Marco Bernardo's Avatar
Marco Bernardo Marco Bernardo is offline
Member
 
Join Date: Jan 2007
Location: Lisboa, Portugal
Posts: 787
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Oliver M View Post

Code:
tell window "Save"
set value of text field 1 to sessioname
end tell
So no need for all this key code stuff. ;-)
Hi Oliver,

I used what you gave in conjunction with this script that I've found from another user

And it could be "automatic" and it remove the Edit: from the name

I know you know how to do it :) you're a master

Code:
on lstripString(theText, trimString)
	-- ljr (http://applescript.bratis-lover.net/library/string/),    modified from Aurelio.net (http://aurelio.net/doc/as4pp.html) -- this part of the script is from this guy
	local theText, trimString, x
	try
		set x to count trimString
		try
			repeat while theText begins with trimString
				set theText to characters (x + 1) thru -1 of theText as text
			end repeat
			return theText
		on error number -1700
			return ""
		end try
	on error eMsg number eNum
		error "Can't trimBoth: " & eMsg number eNum
	end try
end lstripString

display dialog "Open a Pro tools Session and click ok - It will display the name of the session that you're working"

activate application "Pro Tools"
tell application "System Events"
	tell process "Pro Tools"		
		get name of first window whose title contains "Edit: "
		my lstripString(result, "Edit: ")
		set sessionName to result
		display dialog sessionName
	end tell
end tell
I can't stop thank you for all the help
__________________
Marco Bernardo

Dialog Editor, Sound Designer, Re-Recording mixer

nMacPro 6Core/D500/512GB/64Gb ram | PT HD 12 HDN Thunderbolt | HD OMNI | Avid Artist Mix | Novation Impulse 25 | Waves Mercury Native | Audioease All In Bundle | SoundToys | McDSP Classic Pack | DUY Overpack | Arturia Beatstep Pro
Reply With Quote
  #90  
Old 03-15-2016, 05:51 AM
Oliver M Oliver M is offline
Member
 
Join Date: Dec 1969
Location: Europe
Posts: 1,108
Default Re: Automation AppleScripts for Pro Tools (Mac)

Quote:
Originally Posted by Marco Bernardo View Post
Hi Oliver,

I used what you gave in conjunction with this script that I've found from another user

And it could be "automatic" and it remove the Edit: from the name

I know you know how to do it :) you're a master

Code:
on lstripString(theText, trimString)
	-- ljr (http://applescript.bratis-lover.net/library/string/),    modified from Aurelio.net (http://aurelio.net/doc/as4pp.html) -- this part of the script is from this guy
	local theText, trimString, x
	try
		set x to count trimString
		try
			repeat while theText begins with trimString
				set theText to characters (x + 1) thru -1 of theText as text
			end repeat
			return theText
		on error number -1700
			return ""
		end try
	on error eMsg number eNum
		error "Can't trimBoth: " & eMsg number eNum
	end try
end lstripString

display dialog "Open a Pro tools Session and click ok - It will display the name of the session that you're working"

activate application "Pro Tools"
tell application "System Events"
	tell process "Pro Tools"		
		get name of first window whose title contains "Edit: "
		my lstripString(result, "Edit: ")
		set sessionName to result
		display dialog sessionName
	end tell
end tell
I can't stop thank you for all the help

How about this:

Code:
tell application "System Events"
	tell process "Pro Tools"
		set editWindow to (1st window whose title contains "Edit: ")
		set editWindowName to value of attribute "AXTitle" of editWindow
		set sessionName to text 7 thru -1 of editWindowName
		display dialog sessionName
	end tell
end tell
;-)
Reply With Quote
Reply


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 [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


All times are GMT -7. The time now is 10:17 PM.


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