Scripting jump to cue

1,518 views
Skip to first unread message

Joey Buddenberg

unread,
Oct 25, 2012, 10:05:08 AM10/25/12
to ql...@googlegroups.com
Hey all, hope you can help me out. I'm not so much into scripting. I need a script wich plays a certain cue and sets the playback position to the following cue. I found how to start a certain cue, not how to set the playback position to the following cue.

Any help is much appreciated.

Joey

sam kusnetz

unread,
Oct 25, 2012, 10:32:35 AM10/25/12
to ql...@googlegroups.com
does it need to be a script? seems to me like a start cue autofollowed by a goto cue is exactly what you need here...

sk
--
sam kusnetz, sound & projection design | USA-829
503.201.2591
s...@notquite.net
> --
> Change your preferences or unsubscribe here:
> http://groups.google.com/group/qlab
>
> Follow Figure 53 on Twitter: http://twitter.com/Figure53

Rich Walsh

unread,
Oct 25, 2012, 10:42:29 AM10/25/12
to ql...@googlegroups.com
On 25 Oct 2012, at 15:05, Joey Buddenberg wrote:

> Hey all, hope you can help me out. I'm not so much into scripting. I need a script wich plays a certain cue and sets the playback position to the following cue. I found how to start a certain cue, not how to set the playback position to the following cue.

That's a very open question without revealing how you are identifying the "certain cue"; you kind of need to know that to know how to identify the following cue...

Nonetheless, here are two alternatives:

set userCueNumber to "10" -- Assuming you're identifying the cue to start by its Cue Number

tell application "QLab"
tell front workspace

-- Start the cue

set userCue to cue userCueNumber
start userCue

-- Move the playback position

set theCueList to parent of userCue -- Assume that the cue you are starting is in a cue list, and not inside a Group Cue
set playback position of theCueList to cue after userCue
load theCueList -- Load the new cue

end tell
end tell

Or:

set userCueNumber to "10" -- Assuming you're identifying the cue to start by its Cue Number

tell application "QLab"
tell front workspace

set userCue to cue userCueNumber

-- Move the playback position to the first cue

set theCueList to parent of userCue -- Assume that the cue you are starting is in a cue list, and not inside a Group Cue
set playback position of theCueList to cue after userCue

-- Start the cue list, which fires the first cue and stands by for the one after it…

start theCueList

end tell
end tell

You should be able to extrapolate from there to however you are defining your "certain" cue.

Rich

Joey Buddenberg

unread,
Oct 26, 2012, 9:11:14 AM10/26/12
to ql...@googlegroups.com
Hi Rich,


Thanks for your reply. Let's be more specific about what my intentions are.

A collegue of mine is programming an interactive show. There are moments during the show the audience gets the opportunity to decide the outcome of a scene. This results in different actions for QLab depending on their choice. Lets say option 1 is que 10 and option 2 is cue 20. When option 1 gets chosen a simple GO is what's needed. But when option 2 gets chosen it should immediately jump to cue 20. And the playback position of the cuelist should move to the next position (e.g. cue 21).

This can only be done with a script according to Luckydave as a GOTO cue just jumps to a cue bot the playback position stays where its was.

I've been told this GOTO issue will be somewhat different in the next version of Qlab. burt for now we have to stick with scripting.

The different scripts will be triggered via a hotkey.

Thanks again for the script.


Joey

Joey Buddenberg

unread,
Oct 26, 2012, 10:09:51 AM10/26/12
to ql...@googlegroups.com
And when using group cues how should this strin look?


set theCueList to parent of userCue -- Assume that the cue you are starting is in a cue list, and not inside a Group Cue

Thanks!

Joey

Lucas Krech5

unread,
Oct 26, 2012, 10:31:23 AM10/26/12
to ql...@googlegroups.com

The fake endings could be on separate cue lists so all you need do is switch to Cuelist 2 for alternate ending B.

 

-L 

--

Rich Walsh

unread,
Oct 26, 2012, 10:40:50 AM10/26/12
to ql...@googlegroups.com
On 26 Oct 2012, at 15:09, Joey Buddenberg wrote:

> And when using group cues how should this strin look?
>
> set theCueList to parent of userCue -- Assume that the cue you are starting is in a cue list, and not inside a Group Cue

Again, that's too general a question… It doesn't matter what you are trying to achieve or why; what matters is _how_ you are identifying the cues and cue lists involved. By name? By cue number? By unique ID? Selected? Active?

Once you know that it is trivial to then address them to do what you want. The line you have picked out is the quickest general way of finding the relevant cue list, but will only work if the cue you are dealing with is a child of the cue list you are looking for. Perhaps it is easier to just:

set theCueList to first cue list whose name is "The Cue List Of Which You Want To Move The Playback Position"

Alternatively, you could use this routine from http://wiki.figure53.com/QLab+Scripts+and+Macros#x-Navigation-Jump%20to%20Cue%20Target:

set theContainer to parent of userCue
repeat until mode of theContainer is cue_list
set theContainer to parent of theContainer
end repeat
set theCueList to theContainer

Rich

Joey Buddenberg

unread,
Oct 27, 2012, 9:52:02 AM10/27/12
to ql...@googlegroups.com
Hi Rich,


cue to start is 4.10 cue for playback position and load is 4.20 cue list is named KVK and numbered 1.


Joey

Joey Buddenberg

unread,
Oct 27, 2012, 9:53:21 AM10/27/12
to ql...@googlegroups.com
and both cue are group cue's.

Rich Walsh

unread,
Oct 27, 2012, 12:17:09 PM10/27/12
to ql...@googlegroups.com
On 27 Oct 2012, at 14:52, Joey Buddenberg wrote:

> cue to start is 4.10 cue for playback position and load is 4.20 cue list is named KVK and numbered 1.

If everything you are trying to address has a cue number then it really is very simple:

tell application "QLab"
tell front workspace
tell cue list "1"
set playback position to cue "4.10"
start
end tell
end tell
end tell

This fires cue 4.10 and stands by for the following cue. It doesn't load cue 4.10 though.

Rich

Pelicanesque

unread,
Dec 2, 2013, 10:31:41 PM12/2/13
to ql...@googlegroups.com
I reopening this thread because I'm wondering if I can get help with something related...

I have an existing QLab 2 workspace that is fully programmed, but I want to understand the programming better.  There are several cues that receive a MIDI cue from an audio console which triggers a group that contains a tiny snippet of an audio file of silence (like 10ms) with an auto-follow to a script cue that is as follows:

tell front workspace
    tell current cue list
        set playback position to cue id 14
        load
    end tell
end tell

I believe that this may be the Luckydave workaround to the aforementioned "go to" issue.

This command is used to cue up the proper playback position in QLab when selecting a given scene on the audio console. 

What I was trying to do is figure out what the "cue id" is for any given cue.  I can't find this info anywhere. 

Thanks!


Christopher Ashworth

unread,
Dec 3, 2013, 10:24:59 AM12/3/13
to ql...@googlegroups.com
Hi Pelicanesque,

The cue id is a unique identifier that each cue has. It is guaranteed to exist, unlike a cue number.

It is useful to specify a cue when it may or may not have a number. It is not displayed in QLab, but can be queried via scripts.

-C

Pelicanesque

unread,
Dec 4, 2013, 2:38:59 PM12/4/13
to ql...@googlegroups.com
How do I query it via scripts?  Thanks!

Christopher Ashworth

unread,
Dec 4, 2013, 3:21:46 PM12/4/13
to ql...@googlegroups.com
Using the AppleScript Script editor you can view the scripting dictionary for any application.  Using that, you can find:

uniqueID (text, r/o) : The unique ID of the cue.

Pelicanesque

unread,
Dec 5, 2013, 4:04:13 PM12/5/13
to ql...@googlegroups.com
 I managed to do that, but I was wondering how to find out the number of an actual audio cue.  For instance, I have an cue called "Track 12".  I want a script that references Track 12 specifically.  How do I find out it's unique ID?
Thanks!

Christopher Ashworth

unread,
Dec 5, 2013, 4:11:32 PM12/5/13
to ql...@googlegroups.com
I don't think I understand the question.  If you're referencing "Track 12" you're not using the unique ID. Alternately if you already have the cue you can just query for the unique ID….

Pelicanesque

unread,
Dec 6, 2013, 6:49:29 PM12/6/13
to ql...@googlegroups.com
In the example below, the script refers to a "cue ID 14", which actually refers to a cue/audio file called "Walk-in Music" for instance (and 14 doesn't refer to its cue number, because its cue number is 7.5, let's say)...


tell front workspace
    tell current cue list
        set playback position to cue id 14
        load
    end tell
end tell

Let's say that I wanted to use the same script for a new cue, but have it instead set the playback position for a cue I have called "Walk-out Music".  How do I find out "Walk-out Music's" unique id?

I hope that makes sense!
Thanks!

Rich Walsh

unread,
Dec 6, 2013, 6:58:08 PM12/6/13
to ql...@googlegroups.com
This is a ridiculously perverse way of going about things as you would need to select the cue and run a script in AppleScript Editor to get the cue id of the selected cue. Much better to give every cue you want to address via a script a cue number: then use this form to identify the cue:

cue "X" -- Where X is the text that appears in the cue number column for the cue you wish to address

Cue ids are internal AppleScript identifiers that have remarkably little use for general scripting; on the one hand they _must_ exist and _must_ be unique (unlike names or numbers – although the latter must be unique); on the other hand they are all but invisible to the user when working solely in QLab itself.

Rich

Johan

unread,
Dec 7, 2013, 5:02:49 AM12/7/13
to ql...@googlegroups.com

So, maybe I am ridiculously perverse, after all :)

I dont applescript things very often, but when I do I usually refer to the unique ID.
There's an excellent script in the wiki to create a texdocument, Havent tried it in Maverick or Qlab 3 yet though.
But as I recall it gives you a tidy list of whatever you want including the IDs from your qlabfile.

The reason I like to use the ID rather than a name/number is simply because I often create Qlabfiles which I also share with other users.
To keep everything working still, even if someone gets tempted to use the renumber tool, the use of the ID is a good safetyprecaution.



Reply all
Reply to author
Forward
0 new messages