Script & Osc

258 views
Skip to first unread message

gui

unread,
Sep 20, 2022, 4:01:34 PM9/20/22
to QLab
Hello,

I use to use a script with QLab 4 but with QLab 5 I can't compile it because of this :

if (moda = "go") or (moda = "sub fade") or (moda = "sub full") or (moda = "sub min") or (moda = "cue fire") then
        tell workspace 1
            make type "network"
            set thecue to last item of (selected as list)
            set the patch of thecue to 2
            set the osc message type of thecue to custom

What is the new format for : osc message type?

And in the same way this is not working anymore : /cue/active/level/0/0/+ 1
Why?

Thank you so much

Rich Walsh

unread,
Sep 20, 2022, 5:38:51 PM9/20/22
to ql...@googlegroups.com
“osc message type” is no longer relevant as it’s effectively set by how the patch is configured. If you want custom messages just set the “Type” to “OSC Message” in the patch. In terms of scripting them, Network Cues have completely changed and you need to revisit the AppleScript dictionary.

For the second issue, you need to enable “OSC Access”: https://qlab.app/docs/v5/fundamentals/workspace-settings/#the-osc-access-tab. It defaults to off…

Rich

gui

unread,
Sep 21, 2022, 3:18:50 AM9/21/22
to QLab
Sorry i'm ashamed because for the OSC I just forgot to put "localhost" .

For the script I understand what you say but I have other problems.

gui

unread,
Sep 26, 2022, 4:21:43 PM9/26/22
to QLab
I'm still blocked.
Here you can find the script I use to use. If you could help me to repair it I will happy.
You can try it in Qlab4 and see what happen.
Thank you

gui

unread,
Sep 26, 2022, 4:27:43 PM9/26/22
to QLab
Sorry Here the script
Script.qlab5

Rich Walsh

unread,
Sep 27, 2022, 5:50:27 AM9/27/22
to ql...@googlegroups.com
It’s not clear what you’re trying to achieve, in which version of QLab or what isn’t working about it.

You have both of these in the script, which isn’t going to help:

tell application id "com.figure53.QLab.5" to tell front workspace
tell application "QLab 4"

Does it work any better if you set all of your application tell blocks to address the same version of QLab: 

tell application id "com.figure53.QLab.5” […]

Once you’ve fixed that if you can explain what isn’t working it might be possible to fix it.

Have you tried running the script in Script Editor so you can see what’s going on?

Rich

gui

unread,
Sep 28, 2022, 2:21:44 AM9/28/22
to QLab
Thank you Rich for your answer.
This script is working in Qlab 4 but not anymore in Qlab 5. In script editor if i use
        
tell application id "com.figure53.QLab.4" to tell front workspace

It's working but if i use it on Qlab 5 with

tell application id "com.figure53.QLab.5" to tell front workspace

It isn't working.

I know that the network patch is new but I can't manage with the new patch system.

To understand my script the best is to try it in Qlab4.
It's just a shorcut to create network cue (Cue fire, sub fade, udp for Watchout...) with the good colour and the good Cue Number.

Thank you

Rich Walsh

unread,
Sep 28, 2022, 5:13:20 AM9/28/22
to ql...@googlegroups.com
I’m presuming you didn’t write this yourself, and the person who did write it isn’t supporting it? It looks like two scripts mashed together, including a bunch of unused variables. All of the network cue scripting has to be rewritten for QLab 5. I’m not sure I’ve found the best way of dealing with fades yet, but on the other hand your version didn’t create working fades anyway…

I think this generates the same results in QLab 5 as your version does in QLab 4 – I don’t know if these results work though as I don’t have an EOS desk to hand:

-- Network patch 2 = "ETC Eos Family"
-- Network patch 3 = "QLab 5"
-- Network patch 4 = "Plain Text"

tell application id "com.figure53.QLab.5" to tell front workspace


set maListe to {"cue fire", "sub full", "sub min", "sub fade", "go", "START spare son", "UDP"}


choose from list maListe with prompt "Choose from the list."
if result is not false then
set moda to item 1 of result
else
error number -128
end if


if moda is in {"cue fire", "sub full", "sub min"} then
set lxnum to text returned of (display dialog "Create LX Cue - (Cuelist/Cue) - Si vous n'utilisez pas de cue listes entrez juste le numéro de cue." buttons {"Create", "Cancel"} default button 1 default answer "" cancel button "Cancel" with icon note)
else
set lxnum to text returned of (display dialog "Nom du Cue" buttons {"Create", "Cancel"} default button 1 default answer "" cancel button "Cancel" with icon note)
end if


set theOffset to (offset of "/" in lxnum) + 1
set theLabel to text theOffset thru end of lxnum


make type "network"
set thecue to last item of (selected as list)


if moda is in {"cue fire", "sub full", "sub min", "sub fade", "go"} then
set network patch number of thecue to 2
else if moda is "START spare son" then
set network patch number of thecue to 3
else if moda is "UDP" then
set network patch number of thecue to 4
set udpnum to text returned of (display dialog "message UDP" buttons {"Create", "Cancel"} default button 1 default answer "" cancel button "Cancel" with icon note) -- ### Not entirely clear what purpose lxnum serves for this type? ###
end if


if moda is "cue fire" then
set parameter values of thecue to {"cue", "fire", lxnum}
else if moda is "sub full" then
set parameter values of thecue to {"sub", "full", lxnum, "1"} -- Extra parameter in QLab 5 for "Button"
else if moda is "sub min" then
set parameter values of thecue to {"sub", "min", lxnum, "1"} -- Extra parameter in QLab 5 for "Button"
else if moda is "sub fade" then -- ### INFORMATION ABOUT THIS CUE TYPE MISSING FROM ORIGINAL SCRIPT ###
set parameter values of thecue to {"sub", "set", lxnum}
set parameter fades enabled of thecue to {false, false, false, true}
set fade from of thecue to 0 -- ###TBC###
set fade to of thecue to 1 -- ###TBC###
set duration of thecue to 3 -- ###TBC###
else if moda is "go" then
set parameter values of thecue to {"custom", "/eos/key/go"}
else if moda is "START spare son" then
set parameter values of thecue to {"cues", "useActive", lxnum, "all", "start"}
else if moda is "UDP" then
set custom string of thecue to udpnum
end if


if moda is in {"cue fire", "sub full", "sub min"} then
set q name of thecue to "TOP LUX CUE " & theLabel
else if moda is "go" then
set q name of thecue to "LUX " & theLabel
else if (moda = "sub fade") then
set q name of thecue to "LUX SUB " & theLabel
else if moda = "START spare son" then
set q name of thecue to "START Spare Son " & theLabel
else if moda = "UDP" then
set q name of thecue to "Timeline " & theLabel
end if


if moda is "START spare son" then
set q color of thecue to "blue"
else if moda is "UDP" then
set q color of thecue to "purple"
else
set q color of thecue to "orange"
end if


if moda is "cue fire" then
set q number of thecue to "LX Cue " & lxnum
else if moda is "UDP" then
set q number of thecue to "V"
end if


end tell

I have not tested it particularly thoroughly.

Question for Figure 53: is there a built-in way of getting to "/eos/key/go” without using a custom message?

Rich

gui

unread,
Sep 28, 2022, 5:32:29 AM9/28/22
to QLab
Thank you for your answer. I will try it this afternoon.

to write this script I took examples on several already existing scripts and created some lines then I added the dialog box and the colors according to our habits.

gui

unread,
Sep 28, 2022, 5:39:02 PM9/28/22
to QLab
Hello,

Thank you for your help.
I modified the script a bit because some things didn't work and it looks like this now:

        set parameter values of thecue to "/eos/cue/" & lxnum & "/fire"

    else if moda is "sub full" then
        set parameter values of thecue to "/eos/sub/" & lxnum & "/full" -- Extra parameter in QLab 5 for "Button"

    else if moda is "sub min" then
        set parameter values of thecue to "/eos/sub/" & lxnum & "/min" -- Extra parameter in QLab 5 for "Button"

    else if moda is "sub fade" then
        set parameter values of thecue to "/eos/sub/" & lxnum & "/= #v#"
        set parameter fades enabled of thecue to {1, false, false, true}

        set fade from of thecue to 0 -- ###TBC###
        set fade to of thecue to 1 -- ###TBC###
        set duration of thecue to 3 -- ###TBC###
    else if moda is "go" then
        set parameter values of thecue to "/eos/key/" & moda

    else if moda is "START spare son" then
        set parameter values of thecue to {"cues", "useActive", lxnum, "all", "start"}
    else if moda is "UDP" then
        set custom string of thecue to udpnum
    end if
   
   
    if moda is in "cue fire" then

        set q name of thecue to "TOP LUX CUE " & theLabel
    else if moda is in {"sub full", "sub min"} then
        set q name of thecue to "TOP LUX Sub " & theLabel

    else if moda is "go" then
        set q name of thecue to "LUX " & theLabel
    else if (moda = "sub fade") then
        set q name of thecue to "TOP LUX SUB FADE " & theLabel

    else if moda = "START spare son" then
        set q name of thecue to "START Spare Son " & theLabel
    else if moda = "UDP" then
        set q name of thecue to "Timeline " & theLabel
    end if
   
   
    if moda is "START spare son" then
        set q color of thecue to "blue"
    else if moda is "UDP" then
        set q color of thecue to "purple"
    else
        set q color of thecue to "orange"
    end if
   
   
    if moda is in {"sub full", "sub min", "sub fade "} then
        set q number of thecue to "LX Sub" & lxnum
    else if (moda = "cue fire") then
        set the q number of thecue to "LX Cue " & lxnum
    else if moda is "go" then
        set q number of thecue to "LUX GO"
    else if moda = "Start spare son" then
        set the q number of thecue to "START " & lxnum

    else if moda is "UDP" then
        set q number of thecue to "V"
    end if
   
   
end tell

Rich Walsh

unread,
Sep 28, 2022, 6:55:50 PM9/28/22
to ql...@googlegroups.com
I think you ignored this line at the top of the script:

-- Network patch 2 = "ETC Eos Family"

If you configure your patches appropriately then what I wrote and tested generates the same OSC commands as the original did in v4. Your version does not work if you have set network patch 2 to "ETC Eos Family”. I don’t think what you’ve done to the “sub fade” section will work however you’ve configured the patch.

If you want to just use custom strings – and ignore all the new functionality of built-in OSC libraries – then what I said right at the start holds; set the network patch to "OSC Message” and set the custom string property:

set custom string of thecue to "/eos/cue/" & lxnum & "/fire"

Rich

gui

unread,
Sep 29, 2022, 3:29:59 AM9/29/22
to QLab
Hello,
I don't ignored but I was too fast and I put ETC Color. I tried your script again and it works perfectly and it is much better written.
Thank you so much
Reply all
Reply to author
Forward
0 new messages