QLab 5 – OSC Cue Creator Scripts

985 views
Skip to first unread message

Ali Taie

unread,
Sep 1, 2022, 2:53:39 PM9/1/22
to QLab
Hi all,

I had two scripts that I used to rely on quite heavily within my workflow in QLab 4 – One to create an OSC cue with the string "eos/cue/[given cue number]/fire", and one to do the same but using the QLab message type to send an OSC Go to a video machine

I am trying to rework these with the new OSC message framework, but still, to no avail – I haven't seen anything in the way of updates to the AppleScript dictionary for the new network cues in order to put in these variables, so I am not really sure where to even start with this…

For context, here is the old Video OSC Cue generator:

tell application "QLab" to tell front workspace
    set patchNo to 5
    set cueColorVar to "orange"
    set vidCueNo to the text returned of (display dialog "Video cue number please if you wouldnt mind" default answer "")
    if vidCueNo is "" then return
    make type "network"
    set theNewCue to last item of (selected as list)
    set osc message type of theNewCue to qlab
    set patch of theNewCue to patchNo
    set q_num of theNewCue to vidCueNo
    -- set q name of theNewCue to "VIDEO: " & vidCueNo
    set q color of theNewCue to "cerulean"
end tell

And the LX OSC Creator cue is just a simplified version of the "Custom Format OSCcue from Template" from the QLab Cookbook:

tell application "QLab" to tell front workspace
   
    set therepeat to 1
   
    display dialog "LX Cue number please if that's alright " default answer ""
   
    if button returned of result = "cancel" then
        return
    else
       
        set theindex to (text returned of result) as string
       
    end if
   
    set theincrement to 1
   
    set integertype to 1
   
   
    try
       
        if the osc message type of cue "OSCT" is not custom then
        end if
        set thedevicename to notes of cue "OSCT"
        set the thedestinationpatch to patch of cue "OSCT"
        repeat therepeat times
           
            make type "Network"
            set theselectedcue to last item of (selected as list)
            set the patch of theselectedcue to thedestinationpatch
            set the osc message type of theselectedcue to custom
            set thecustommessage to the custom message of cue "OSCT"
            set AppleScript's text item delimiters to "$$$"
            set the item_list to every text item of thecustommessage
            set AppleScript's text item delimiters to theindex as string
            set thecustommessage to the item_list as string
            set the custom message of theselectedcue to thecustommessage
            set the q color of theselectedcue to "Purple"
           
        end repeat
       
    end try
   
end tell  


Any help with modifying, simplifying, or a completely new version of these scripts would be greatly appreciated! I imagine with the built-in OSC integration for EOS consoles the need for a "custom from template" type cue is no longer necessary, but happy to learn more about this regardless

Thanks in advance

Sam Kusnetz

unread,
Sep 1, 2022, 4:10:43 PM9/1/22
to ql...@googlegroups.com
Hello Ali

You’ll need to make a few small changes to support the different way that QLab 5 handles Network cues and patches.

In you first script, cut this line, because Network cues no longer have message types (network patches do instead):

    set osc message type of theNewCue to qlab

Change this line:

    set patch of theNewCue to patchNo

to:

set network patch number of theNewCue to patchNo

In your second script, change this line:

set the thedestinationpatch to patch of cue "OSCT"

to:

set thedestinationpatch to network patch number of cue “OSCT"

Change this line:

set the patch of theselectedcue to thedestinationpatch

to:

set the network patch number of theselectedcue to thedestinationpatch

Cut this line:

set the osc message type of theselectedcue to

Change this line:

set thecustommessage to the custom message of cue “OSCT"

to:

set thecustommessage to the parameter values of cue “OSCT"

Change this line:

set the custom message of theselectedcue to thecustommessage

to:

set the parameter values of theselectedcue to thecustommessage


That should do it!

Best
Sam
Sam Kusnetz (he/him) | Figure 53


Ali Taie

unread,
Sep 1, 2022, 4:42:07 PM9/1/22
to QLab
Hi Sam,

Thank you for the response! 

This has fixed the network patch issue I was getting with the scripts as they were previously! The second script has mysteriously stopped working, but I cross-checked it with the same script in QLab 4 and the same result – no errors, no warnings, just simply not making an OSC cue

I did however modify the first script to achieve the same thing (just by changing the patch number), but I am struggling with the syntax to get the cue number into the OSC cue (an issue I'm also having with the video cue creation script)

Here's what the video script looks like now:

tell application "QLab" to tell front workspace
   
    set vidCueNo to the text returned of (display dialog "Video cue number please if you wouldnt mind" default answer "")
    if vidCueNo is "" then return
    make type "network"
    set theNewCue to last item of (selected as list)
    set network patch number of theNewCue to 5
    >>> set cue number of theNewCue to vidCueNo <<< (This line returns a message saying "ERROR: QLab got an error: Can't make number go into type integer. (-1700)")

    set q color of theNewCue to "cerulean"
   
end tell 


The resultant cue also has a Workspace type rather than a Cues type but I'm not sure I know the command to change that when making a new cue


And here is what the LX script looks like now:

tell application "QLab" to tell front workspace
   
    set lxCueNo to the text returned of (display dialog "LX cue number please" default answer "")
    if lxCueNo is "" then return

    make type "network"
    set theNewCue to last item of (selected as list)
    set network patch number of theNewCue to 4
    set q color of theNewCue to "Purple"
    set cue number of theNewCue to lxCueNo
   
end tell

I am experiencing the same problem and the same error as above, but strangely the cue created has a QLab (Workspace) message type instead of an ETC Eos Family type (even though the patch is set to ETC Eos Family)

Thanks again for the help!

Brent Lord

unread,
Sep 2, 2022, 8:12:09 AM9/2/22
to QLab
Hi there!

The property to set a cue number is "q number" rather than "cue number". That should fix the two errors in the scripts above when setting those values.

For the patch, the "network patch number" property refers to the 1-indexed position of a patch in the Network settings > Network > Network Outputs list. So in the second script, the line "set network patch number of theNewCue to 4" will set whichever patch is 4th in your list at the time you run the cue, with message type according to that patch. You can also refer to a specific patch no matter what position it holds in the patches list using "network patch id" or "network patch name" properties.

I hope that helps!
Brent

Ali Taie

unread,
Sep 2, 2022, 8:33:28 AM9/2/22
to QLab
Hi Brent,

Thank you for the advice! 

The cue number I'm actually trying to set is the Target Cue Number within the network cue itself rather than the q number within the cue stack – I imagine there is also a missing line about changing the Type from "QLab" to "Cues", and a line to set the Command to "Start", but I'm not sure of the correct syntax for either of those

As for the patch – I'm not sure if this is a bug but currently my network patch 4 is set to send ETC Eos family type commands, but when using this script, the resultant cue has a QLab 5 type framework even though it is using the correct patch (screenshot attached below)

Thanks again for the help

Screenshot 2022-09-02 at 13.32.39.png

Brent Lord

unread,
Sep 2, 2022, 11:34:40 AM9/2/22
to QLab
Thanks for pointing out that inspector bug. We will look into that. 
In my tests, if you deselect the cue and reselect it, the inspector should show the correct parameters for your patch.

For setting one of the parameter values in a cue assigned to an EOS patch, you can use the new Network Cue "parameter values" property. This returns an AppleScript "list", which contains the values needed to populate the cue. Note that in most cases, parameter values for menu items are going to be different from their display name. 

You can work with the list items like this:

tell application id "com.figure53.QLab.5" to tell front workspace
    set theCue to cue "5"
    set theParameterValues to parameter values of theCue
    set item 3 of theParameterValues to "2" -- this sets the value for the 3rd parameter in the Network cue inspector
    set parameter values of theCue to theParameterValues
end tell

Brent

Ali Taie

unread,
Sep 2, 2022, 11:59:44 AM9/2/22
to QLab
Hi Brent,

Thank you for this – my EOS creator script now works flawlessly, and yes the inspector bug is fixed by deselecting the cue and reselecting it

Is this the same in the case of setting the parameter values in a cue assigned to a QLab 5 patch, or is there a different network cue property I need to be using (and what would the script look like in either situation??

Cheers! 

Brent Lord

unread,
Sep 2, 2022, 1:22:09 PM9/2/22
to QLab
See the script below, where cue "20" is a Network cue set to an "ETC Eos family" patch in this configuration::

Screen Shot 2022-09-02 at 1.19.14 PM.png

tell application id "com.figure53.QLab.5" to tell front workspace
    set theCue to cue "20"
    set theCueTargetNumber to "30" -- or some other cue number

    set theParameterValues to parameter values of theCue
    set item 3 of theParameterValues to theCueTargetNumber

    set parameter values of theCue to theParameterValues
end tell

We have a fix in place for the Inspector updating bug which will be included in the 5.0.1 update.
Until then, yes you probably need to deselect and reselect the Network cue to get the inspector to show parameters set by a Script cue.

Brent  

Ali Taie

unread,
Sep 2, 2022, 1:37:15 PM9/2/22
to QLab
Perfect, that is working for me – I am using the script below with an option to create a dialogue box that sets the cue number:

tell application "QLab" to tell front workspace
   
    set lxCueNo to the text returned of (display dialog "LX cue number please" default answer "")
    if lxCueNo is "" then return
    make type "network"
    set theNewCue to last item of (selected as list)
    set network patch number of theNewCue to 4
    set q color of theNewCue to "purple"
    set theParameterValues to parameter values of theNewCue
    set item 3 of theParameterValues to lxCueNo
    set parameter values of theNewCue to theParameterValues
   
end tell

I am however wondering how I would apply the same logic for a script that prints a cue with a QLab 5 network message type??

Here is my attempt at doing this (but as you can imagine it is not working):

tell application "QLab" to tell front workspace
   
    set vidCueNo to the text returned of (display dialog "Video cue number please if you wouldnt mind" default answer "")
    if vidCueNo is "" then return
    make type "network"
    set theNewCue to last item of (selected as list)
    set network patch number of theNewCue to 5

    set q color of theNewCue to "cerulean"
    set theParameterValues to parameter values of theNewCue
    set item 1 of theParameterValues of theCue to "Cues"
    set item 3 of theParameterValues to vidCueNo
    set item 5 of theParameterValues to "Start"

    set parameter values of theCue to theParameterValues
   
end tell

Thanks for the bug update also – very helpful!

Brent Lord

unread,
Sep 2, 2022, 6:48:04 PM9/2/22
to QLab
Just a few things to tweak in that script. This one below is working for me:

tell application "QLab" to tell front workspace
   
    set vidCueNo to the text returned of (display dialog "Video cue number please if you wouldnt mind" default answer "")
    if vidCueNo is "" then return
    make type "network"
    set theNewCue to last item of (selected as list)
    set network patch number of theNewCue to 5 -- where 5 is a "QLab" Network cue patch

   
    set q color of theNewCue to "cerulean"
    set theParameterValues to {"cues", "useActive", vidCueNo, "all", "start"}

    set parameter values of theNewCue to theParameterValues
   
end tell


A couple of places I think you meant "theNewCue" instead of "theCue". 
And AppleScript lists are funny. If a list has 3 items, you need to use "set the end of..." to add more items, so I find it easier to just define the whole list outright.

Last, you'll see that the parameter values themselves don't always match their display text, especially in menus. That's kind of tricky I realize, and a detail of how this Network cue behavior is implemented behind the scenes. In the next update, I'm going to make a note to see if we can help expose those values easier for people like yourself to use in scripts easier.

Brent

Ali Taie

unread,
Sep 2, 2022, 7:37:27 PM9/2/22
to QLab
Ah, great, this now works for me too!

I am not entirely familiar with Applescript lists (beyond say giving options in a dialogue box), so thank you for clarifying this!

I completely understand that some parts of the parameter values can differ from what is displayed vs what is behind the scenes, and some efforts to expose them would certainly make it easier for many like me, but of course, I don't expect more time and effort spent towards this than more pressing matters

Again, thank you very much for all your patience and help with this – it will pave the way for some great speed and workflow improvements for me 

Cheers,
– A
Reply all
Reply to author
Forward
0 new messages