No way to script (applescript) timecode triggers?

119 views
Skip to first unread message

Andrew Nagy

unread,
Jan 16, 2015, 4:14:55 PM1/16/15
to ql...@googlegroups.com
Im working through an apple script and just came up against a roadblock.

It doesnt seem like there is any way to script in the actual timecode trigger "time" into a script that creates new cues. I see that I can enable it but past that I can't actually set the time? Is this true?

Here's the script I have so far

tell application "QLab"
activate
tell application "QLab"
try
get selected of front workspace
on error
display dialog "There is no workspace open in QLab." with title dialogTitle with icon 0 ¬
buttons {"OK"} default button "OK" giving up after 5
return
end try
end tell
tell front workspace
repeat 1 times
make type "MIDI"
set newCue to last item of (selected as list)
set channel of newCue to "2"
set byte one of newCue to "3"
set command of newCue to program_change
set q name of newCue to "Test"
set timecode trigger of newCue to enabled
//How do I set the timecode now?
end repeat
end tell
end tell


micpool

unread,
Jan 16, 2015, 4:57:57 PM1/16/15
to ql...@googlegroups.com
You can set it through the OSC API

Look at the recent thread scripting problem, last post,for a solution you can adapt to this case.


Mic

micpool

unread,
Jan 16, 2015, 7:26:41 PM1/16/15
to ql...@googlegroups.com
Sorry, It appears you can't. I was doing the OSC API from memory and confused the OSC timecode from the MIDI cue with the timecode trigger.
Mic

Andrew Nagy

unread,
Jan 16, 2015, 7:28:45 PM1/16/15
to ql...@googlegroups.com, ql...@googlegroups.com
I'm doing it with ui scripting. Tab 9 times. Enter code. It works ok for what I need (turning 289 cues into qlab timecode)

Thanks mic!



--
--
Change your preferences or unsubscribe here:
http://groups.google.com/group/qlab

Follow Figure 53 on Twitter: http://twitter.com/Figure53

---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Andrew Nagy

unread,
Jan 16, 2015, 7:31:51 PM1/16/15
to ql...@googlegroups.com
Heres the final script if it's ever useful to anyone:

set csvData to read "/Users/andrewnagy/Desktop/test.csv"

set csvEntries to paragraphs of csvData

set vals to {}
set AppleScript's text item delimiters to ","

tell application "QLab"
activate
tell application "QLab"
try
get selected of front workspace
on error
display dialog "There is no workspace open in QLab." with title dialogTitle with icon 0 ¬
buttons {"OK"} default button "OK" giving up after 5
return
end try
end tell
tell front workspace
repeat with i from 1 to length of csvEntries
set vals to text items of (item i of csvEntries)
set theCue to item 1 of vals
set theTrack to item 2 of vals
set theTimecode to item 3 of vals
set finalTimecode to theTrack & ":" & theTimecode
set theChannel to item 4 of vals
set theNumber to item 5 of vals
make type "MIDI"
set newCue to last item of (selected as list)
set channel of newCue to theChannel
set byte one of newCue to theNumber
set command of newCue to program_change
set q name of newCue to finalTimecode
set q number of newCue to theCue
set timecode trigger of newCue to enabled
delay 0.1 -- This gives you a chance to see the current state
tell application "System Events"
ignoring application responses
tell application "QLab"
activate
end tell
tell application process "QLab"
tell front window
UI elements
repeat 9 times
keystroke tab
end repeat
keystroke finalTimecode
keystroke tab
end tell
end tell
end ignoring
end tell
delay 0.5
end repeat
end tell
end tell

To unsubscribe from this group and stop receiving emails from it, send an email to qlab+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages