[QLab] Scripting colors

1,698 views
Skip to first unread message

Clay Benning

unread,
Feb 8, 2010, 11:26:34 PM2/8/10
to Discussion and support for QLab users.
Anyone know if it is possible to set a color code for a cue via a
script? Example: If I wanted to have a script that would go through a
workspace and set all fade cues to red, all GoTo cues to green, etc....

Thanks,
Clay


________________________________________________________
WHEN REPLYING, PLEASE QUOTE ONLY WHAT YOU NEED. Thanks!
Change your preferences or unsubscribe here:
http://lists.figure53.com/listinfo.cgi/qlab-figure53.com

luckydave

unread,
Feb 9, 2010, 12:07:18 AM2/9/10
to Discussion and support for QLab users.
I don't think that's there yet. Looking in the scripting definitions, all i come across is "Color" from the Standard Suite, not the QLab Suite, and the Cue class doesn't have a Color element.

Do the things that please you, and do them well.


--- On Mon, 2/8/10, Clay Benning <cl...@stoutpost.com> wrote:

Christopher Ashworth

unread,
Feb 9, 2010, 5:40:42 AM2/9/10
to Discussion and support for QLab users.
luckydave is correct; it's not yet supported, but on the to-do list

On Feb 9, 2010, at 12:07 AM, luckydave wrote:

> I don't think that's there yet. Looking in the scripting
> definitions, all i come across is "Color" from the Standard Suite,
> not the QLab Suite, and the Cue class doesn't have a Color element.
>

> --- On Mon, 2/8/10, Clay Benning <cl...@stoutpost.com> wrote:
>
>> Anyone know if it is possible to set
>> a color code for a cue via a script?

raymond soly

unread,
Feb 9, 2010, 10:23:30 AM2/9/10
to Discussion and support for QLab users.
you can do this in Qlab ........., you can set colors for cues in the
inspector..........but you have to do it one at a time.!....


Ray

Stephen Swift

unread,
Feb 9, 2010, 1:59:26 PM2/9/10
to Discussion and support for QLab users.
> On 8-Feb-10, at 11:26 PM, Clay Benning wrote:
>
>> Anyone know if it is possible to set a color code for a cue via a script?

You can change the color via UI scripting too, although it's more
clunky, and harder to test since it relies on the UI elements to be
where they are expected. Beware of linebreaks and the usual problems
copying scripts from email. If you don't really need a script
solution, wait for official support. ;-)

This script changes the color of all the selected cue (you choose the
color from a list). You should be able to figure out how to modify
the script to itinerate through all the cue in a list, if it's q type
x then color it y.

~Stephen

set colorList to {"1 Cantaloupe", "2 Honeydew", "3 Spindrift", "4
Sky", "5 Lavender", "6 Carnation", "7 Licorice", "8 Snow", "9 Salmon",
"10 Banana", "11 Flora", "12 Ice", "13 Orchid", "14 Bubblegum", "15
Lead", "16 Mercury", "17 Tangerine", "18 Lime", "19 Sea Foam", "20
Aqua", "21 Grape", "22 Strawberry", "23 Tungsten", "24 Silver", "25
Maraschino", "26 Lemon", "27 Spring", "28 Turquoise", "29 Blueberry",
"30 Magenta", "31 Iron", "32 Magnesium", "33 Mocha", "34 Fern", "35
Moss", "36 Ocean", "37 Eggplant", "38 Maroon", "39 Steel", "40
Aluminum", "41 Cayenne", "42 Asparagus", "43 Clover", "44 Teal", "45
Midnight", "46 Plum", "47 Tin", "48 Nickel"}
set colorResult to choose from list colorList with title "Cue Colors"
with prompt "Select a Color" without multiple selections allowed and
empty selection allowed
if (colorResult is not false) then
set myColor to (word 1 of item 1 of colorResult) as integer
else
error number -128 --exit script
end if

tell application "QLab"
set WinName to q number of window 1
tell workspace 1
set mySel to selected
repeat with myCue in mySel
set playback position of current cue list to myCue
my colorCue(myColor, WinName)
end repeat
end tell
end tell

on colorCue(myColor, myWindow)
activate application "QLab"
tell application "System Events"
get system attribute "sysv"
if result is greater than or equal to 4144 then -- Mac OS X 10.3.0
if UI elements enabled then
tell application process "QLab"
repeat 6 times
key code 123 using {command down} -- left arrow Key
end repeat

if "Colors" is in (get name of windows) then
click button 1 of window "Colors"
end if

click color well 1 of window myWindow

tell window "Colors"
-- get description of UI elements
{"close button", "zoom button", "minimize button", "color well",
"group", "button", "toolbar", "toolbar button", "text", "grow area"}
tell tool bar 1
--get help of buttons
(* {"Color Wheel", "Color Sliders", "Color Palettes", "Image
Palettes", "Crayons"} *)
click button 5 (* to display "Crayons" *)
end tell -- tool bar
--get description of UI elements
(* {"group"} *)
tell group 1
get description of UI elements
tell group 1
--get description of UI elements
(* {"radio group"} *)
tell radio group 1
--get value of attribute "AXDescription" of UI elements
click radio button myColor
end tell -- radio group
end tell
end tell
click button 1 -- to close the Colors window
end tell

end tell
else
beep
display dialog "GUI Scripting is not enabled" & return & return &
"Open System Preferences and check Enable Access for Assistive Devices
in the Universal Access preference pane, then run this script again."
with icon stop
if button returned of result is "OK" then
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
end tell
end if
end if
else
beep
display dialog "This computer cannot run this script" & return &
return & "The script uses GUI Scripting technology, which requires an
upgrade to Mac OS X 10.3 Panther or newer." with icon caution buttons
{"Quit"} default button "Quit"
end if
end tell

end colorCue

JB

unread,
Jun 7, 2017, 4:12:44 PM6/7/17
to QLab, ql...@lists.figure53.com
Sorry for digging up a 7 year old thread. But this request seems to be "on the to-do list" since 2010. Is there any chance that it will be implemented? I would even more like to have a way to read the color of a cue via AppleScript. I'd like to be able to trigger cues only if they have a certain color.

Thanks
Jens

Sam Kusnetz

unread,
Jun 7, 2017, 4:25:33 PM6/7/17
to JB, ql...@googlegroups.com, ql...@lists.figure53.com
Hello Jens

It’s been on the to-do list since 2010, but not requested very often as you can tell by the age of this thread!

You can get and set cue color via OSC… `/cue/x/colorName red` will set cue x to red, for example. So you can get to it in AppleScript through shell scripting and a tool such as netcat.

I cannot say when (or even if) we’ll add AppleScript access to cue colors, but I’m glad to know that you want it and I’ll make sure to add your vote to the issue.

Best
Sam

Sam Kusnetz | Figure 53
--
Contact support anytime: sup...@figure53.com
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/fd2ee08c-86e0-4b93-a2b3-b3af30a31d0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JB

unread,
Jun 7, 2017, 4:55:19 PM6/7/17
to QLab, jens....@gmx.de, ql...@lists.figure53.com
Hi Sam,

thanks for the update! I think it would be handy to have a way to mark cues in some way or another and read that mark in AppleScript. Colors seem like a good way to do that because you can have more than one. For my purpose I can work with the "flagged" property, with is readable via AppleScript. But then of course I can't use the flag mark for anything else. And I get a warning every time I open a workspace with flagged cues.

Anyway, in case this feature never gets implemented: I know that i can set the color with OSC and even send a message to QLab to ask for the color of a cue and get an answer. But how would I be able to use that answer back in QLab? I think I could send the answer to another app to convert in a message that QLab understand (/go etc.) and send it back to QLab. But that would be quite cumbersome to say the least.

Btw, I never could send a OSC message from AppleScript or even terminal to QLab using nc. Something like:
do shell script "echo /go | nc -u -w 0 127.0.0.1 53000" (AppleScript) and
echo /go | nc -u -w 0 127.0.0.1 53000 (Terminal)
does not work for me (macOS 10.11.6). I am using a tool called sendosc which does work but I'd like to minimize the amount of external tools I have to use.

Jens

Sam Kusnetz

unread,
Jun 7, 2017, 4:56:52 PM6/7/17
to ql...@googlegroups.com
Jens

You know… I’m not sure! But I believe this conversation we’ve had has spurred one of the QLab developers to explore the issue, so you might get your wish in QLab 4.1…

Best
Sam

Sam Kusnetz | Figure 53

JB

unread,
Jun 7, 2017, 5:00:12 PM6/7/17
to QLab
Great! I'll keep my fingers crossed! ;-)

Thanks
Jens

Rich Walsh

unread,
Jun 7, 2017, 5:32:55 PM6/7/17
to ql...@googlegroups.com
Could that be because you need to send it on port 53535: https://figure53.com/docs/qlab/v4/scripting/osc-dictionary-v4/#transport-layer?

I looked into how to incorporate OSC replies into AppleScript in this thread: https://groups.google.com/d/topic/qlab/FVKr4nH5KNY/discussion. I think the upshot is that you have to use a dummy cue and have QLab parse the OSC response to something you can then query in AS.

Rich

JB

unread,
Jun 7, 2017, 6:14:06 PM6/7/17
to QLab
Hi Rich,

thank you, sending on port 53535 does work. QLab's workspace preferences say that "QLab listens on TCP & UDP port 53000.", so I thought, well, that QLab would listen on UDP port 53000. ;-)

I did not know that there is a difference between text and an actual OSC command sent via UDP. That explains why sendosc works on port 53000, because it sends actual OSC commands. On port 53535 QLab tries to interpret text as an OSC command. "echo ... | nc ..." sends plain text, so this has to go to port 53535.

I will look into the use of dummy cues! Could you tell me where to find "Mic’s work on animated eyeballs" you mentioned in the other discussion?

Thanks again,
Jens

Rich Walsh

unread,
Jun 7, 2017, 6:34:31 PM6/7/17
to ql...@googlegroups.com

JB

unread,
Jun 8, 2017, 5:11:58 AM6/8/17
to QLab
Thanks Rich!
I was able to implement what I needed and posted an example here: https://groups.google.com/forum/#!topic/qlab/0tlhV3vfSSc

Jens

JB

unread,
Jun 17, 2017, 5:35:03 AM6/17/17
to QLab
For reference to anyone who finds this thread:
Cue color get/set via AppleScript is implemented since QLab 4.1beta1.
Thank you Figure53!

Steve Sweeney

unread,
Jan 4, 2019, 12:34:21 PM1/4/19
to QLab
Does This Include Buttons?

For example : I Press a Button for a CUE and now the Button Color changes?

If so, how would I achieve this function?

Thanks so much!

Steve

micpool

unread,
Jan 4, 2019, 1:06:52 PM1/4/19
to QLab
Yes.... but......

You could put a script cue on the button that changed the color and starts another cue e.g an audio cue

Or

You could put a start cue on a button that starts a timeline group containing a script or network cue to change the button color and other cues e.g an audio cue


But....

If you are trying to emulate a cart player with lighty up buttons when a cue is playing then you have to work out how to change the color again when the cue finishes or when stopped either explicitly, or when ESC is pressed, which is trickier.

Mic

Reply all
Reply to author
Forward
0 new messages