Re: [QLab] Wall Clock & AppleScript

397 views
Skip to first unread message

Rich Walsh

unread,
Mar 27, 2013, 6:31:05 PM3/27/13
to ql...@googlegroups.com
You should start here: http://wiki.figure53.com/QLab+Scripts+and+Macros – although there's no specific example that translates directly for your purpose. You should also examine QLab's AppleScript dictionary to see how the wall clock properties of a cue work.

The first thing you need to do is to find a way of identifying the cue whose wall clock trigger you want to adjust; the easiest way is to give it a cue number and use that. Next, you'll need to get the text returned from a display dialog with a text entry box – and then parse it into hours and minutes, as these are separate properties for a cue. Finally, you tell the cue to set those properties.

This will work as a Script Cue, but it has absolutely NO error protection and assumes the time is being entered only in the form HH:MM:

set userCueNumber to "1" -- Use this to identify the cue whose wall clock properties you are trying to set

-- Prompt to get the time

set triggerTime to text returned of (display dialog "What time will the park close?" default answer "")

-- Parse the time into hours & minutes

set currentTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set triggerHours to text item 1 of triggerTime
set triggerMinutes to text item 2 of triggerTime
set AppleScript's text item delimiters to currentTIDs

-- Set the cue's properties

tell cue userCueNumber of front workspace
set wall clock trigger to enabled -- This may not be essential, but it does need to be on!
set wall clock hours to triggerHours
set wall clock minutes to triggerMinutes
end tell

You can entertain yourself working out how to protect it from things like "7pm", "1100", "6.45", and so on! "Choose from list" might actually be a better option…

Rich

On 27 Mar 2013, at 20:15, Jonny Burns <in...@cybersoundentertainments.co.uk> wrote:

Trying to do something clever, and need some help.

Lets say I have an audio file as a cue- and I want it to be triggered by the wall clock.

I want a dialogue box to pop up when an AppleScript cue is activated, that will ask the user the following question:

'What time will the park close?'

When the user puts in a time, I want QLab to input that data into the wallclock for the audio cue.

So if the user types in '19:00', then that audio cue will play at 7pm.

Is this possible? If so, where do I start with the apple scripting?

Cheers!

Jonny Burns

unread,
Mar 29, 2013, 6:12:56 PM3/29/13
to ql...@googlegroups.com
Rich, thank you - this is fantastic and worked flawlessly. 
Reply all
Reply to author
Forward
0 new messages