Applescript in Pro Tools
Hi All,
I'm fairly new tho Applescript, but have been playing around with it to try and speed up my workflow on some software I use for work called Pro Tools.
Basically, quite often there is a very monotonous task I need to do, which is cycle through large amounts of "markers" (200-300+ sometimes) and press V, then K, then move onto the next and repeat. I'm trying to create an applescript to speed this up for me. To move to markers you type ".1." (without quotations) for example and that will take you to marker number 1, where I then need to press V, K then type ".2." to move to marker 2 and so on.
My script is working, but needs some tweaks.
tell application "Pro Tools"
activate
--Display Dialog and Get Input
display dialog "How many markers?" default answer ""
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "1"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "v"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "k"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "2"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "v"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "k"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "3"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "v"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "k"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "4"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "v"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "k"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "5"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "."
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "v"
delay 0.02
tell application "System Events" to tell process "Pro Tools" to keystroke "k"
end tell
So this shows my script that works up to Marker 5, then ends. This is my first "working" script, so its probably very messy/inefficient!
The display dialog in there at the moment does nothing, but ideally I'd like to be able to type how many markers I have in there. And then have the script type in the process for me, up until the number of which I typed in. So for example, if I typed in that I have 157 markers, it would repeat the process up until marker 157, and then stop.
Is there a way I'm missing to achieve this? Or is it too complicated/going about this in a very stupid way?
Thanks!
MacBook Pro (15-inch Mid 2012), iOS 8