rename cues

405 views
Skip to first unread message

fg

unread,
Apr 24, 2023, 5:24:12 AM4/24/23
to QLab
Hi there, 

I'm looking for a script to loop through the current list and rename all cues (and their notes)

So it would take the current name, and add add some text to the beginning

The notes and names are identical

Thanks!

micpool

unread,
Apr 24, 2023, 8:39:57 AM4/24/23
to QLab

-- prefix the q name with a prefix string and copy the new name to the notes of all cues in the current cue list

set thePrefix to "Modified " --Text to Prefix cue names with

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

set theList to {}

set theCues to cues of current cue list

repeat with eachcue in theCues

set the q name of eachcue to (thePrefix & the q list name of eachcue)

set the notes of eachcue to the q list name of eachcue

end repeat

end tell


Mic

fg

unread,
Apr 24, 2023, 10:39:42 AM4/24/23
to QLab
Thanks Mic, that works!

This changes the notes, but resets the font styles. Is there a way preserve them?

micpool

unread,
Apr 24, 2023, 12:10:08 PM4/24/23
to QLab
I don't know of a way to preserve the font styles when setting the notes of a cue by AppleScript or OSC.

Are you trying to get big text in the notes field that can be read at a distance?

Mic

fg

unread,
Apr 24, 2023, 12:11:52 PM4/24/23
to QLab
Ah no worries, yes that's right. Read it from the stage

Sam Kusnetz

unread,
Apr 24, 2023, 12:12:15 PM4/24/23
to ql...@googlegroups.com
On Apr 24, 2023 at 12:10:07 PM, micpool <m...@micpool.com> wrote:
I don't know of a way to preserve the font styles when setting the notes of a cue by AppleScript or OSC.

Because of the way rich text styling works in macOS, the only way to preserve styling is to programmatically copy the style then reapply it after replacing the text, or leave some of the original text in place which will dictate the style of the new text.

-sk
Sam Kusnetz (he/him) | Figure 53


micpool

unread,
Apr 24, 2023, 12:54:20 PM4/24/23
to QLab
On Monday, April 24, 2023 at 5:12:15 PM UTC+1 sam kusnetz wrote:
Because of the way rich text styling works in macOS, the only way to preserve styling is to programmatically copy the style then reapply it after replacing the text, or leave some of the original text in place which will dictate the style of the new text.

Hi Sam
Can you give a practical example of how you might do that?

Mic 

micpool

unread,
Apr 24, 2023, 1:46:48 PM4/24/23
to QLab
On Monday, April 24, 2023 at 5:11:52 PM UTC+1 fg wrote:
yes that's right. Read it from the stage

If you have a video licence then you can display info in big  type like this:
Disable the space bar in settings Key Map and any MIDI triggers for GO
Make a timeline group and trigger that with the space Bar and any MIDI triggers you use for GO
In the timeline group put the script below  and a text cue formatted how you want e.g text size 150, centred

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

go

set theNext to last item of (selected as list)

set theText to "Cue: " & q number of theNext & return & q list name of theNext

set the text of cue "INFO" to theText

end tell


You can also the same for up and down


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

movePlayheadUpASequence

set theNext to last item of (selected as list)

set theText to "Cue: " & q number of theNext & return & q list name of theNext

set the text of cue "INFO" to theText

end tell



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

movePlayheadDownASequence

set theNext to last item of (selected as list)

set theText to "Cue: " & q number of theNext & return & q list name of theNext

set the text of cue "INFO" to theText

end tell


Screenshot 2023-04-24 at 18.45.49.png






Mic
Screen Recording 2023-04-24 at 18.41.42.mov

micpool

unread,
Apr 24, 2023, 1:48:44 PM4/24/23
to QLab
Demo Workspace for above
Mic
Next Cue.zip

Sam Kusnetz

unread,
Apr 24, 2023, 2:09:07 PM4/24/23
to ql...@googlegroups.com
I believe I am mistaken in fact… the text style of the text in the notes field does not appear to be scriptable at all.

I had mistakenly believe that it inherited the scriptable attributes of other cocoa text editing fields, but that is not the case.

Best
Sam

micpool

unread,
Apr 24, 2023, 2:31:06 PM4/24/23
to QLab
On Monday, April 24, 2023 at 5:12:15 PM UTC+1 sam kusnetz wrote:
Because of the way rich text styling works in macOS, the only way to preserve styling is to programmatically copy the style then reapply it after replacing the text, or leave some of the original text in place which will dictate the style of the new text.
 
On Apr 24, 2023 at 1:48:44 PM, micpool <m...@micpool.com> wrote:
Can you give a practical example of how you might do that?

 On Monday, April 24, 2023 at 7:09:07 PM UTC+1 sam kusnetz wrote:
I believe I am mistaken in fact… the text style of the text in the notes field does not appear to be scriptable at all.

That's the conclusion I came to as well. There is probably a really complex UI scripting method to cut and paste, probably involving a command line interface extension, but having failed to manage to select all the text in the notes field ready for a format preserving paste I gave up!

Mic

fg

unread,
Apr 25, 2023, 10:18:14 AM4/25/23
to QLab
Another quick Q. Is it possible to have this list work on Groups too? I affects everything in the root of the list, but not nested groups

micpool

unread,
Apr 25, 2023, 11:24:14 AM4/25/23
to QLab
On Monday, April 24, 2023 at 5:11:52 PM UTC+1 fg wrote:
yes that's right. Read it from the stage

You can also use this simple OSC to text display to show the info for the next cue

Screenshot 2023-04-25 at 16.03.39.png 

Download here (test thoroughly before using in a show ! etc.)


MicsTextDisplay
A simple OSC controlled resizable 2 line display. (25 characters) 
Uses Port 8900 
/line1 (text for line1}
/line2 {text for line 2}

Demo Screen recording and workspace attached

PS I haven't tested using emojis as cue numbers, so there may be unintended consequences (you know the drill, test thoroughly before using in a show ! etc.)


Mic
MicsTextDisplay Demo.qlab5
MicsDisplayText.mov

fg

unread,
Apr 25, 2023, 11:35:05 AM4/25/23
to QLab
that's really cool. It doesn't work for me but I guess that's because I'm on Qlab 4?

There is something similar from Audio Ape called Lab Monkey which will display it on an iPad, as long as Laptop and iPad on same network, but I'm willing to give this a go!

micpool

unread,
Apr 25, 2023, 11:57:11 AM4/25/23
to QLab
Probably simplest to unfold the groups (shift >) select all (cmd-a ) and change the script to 

-- prefix the q name of selected cues with a prefix string and copy the new name to the notes of all cues in the current cue list

set thePrefix to "Modified " --Text to Prefix cue names with
tell application id "com.figure53.QLab.5" to tell front workspace
set theCues to (selected as list)

repeat with eachcue in theCues
set the q name of eachcue to (thePrefix & the q list name of eachcue)
set the notes of eachcue to the q list name of eachcue
end repeat
end tell

Mic

fg

unread,
Apr 25, 2023, 12:00:05 PM4/25/23
to QLab
Thanks Mic!

micpool

unread,
Apr 25, 2023, 12:16:39 PM4/25/23
to QLab
Works fine in QLab 4
Obviously you need to open the Text Display app if you don't have a script cue to do that for you.

Here's roughly the same workspace inQLab  4 just using OSC cues

Screenshot 2023-04-25 at 17.12.06.png
 
Mic
MicsTextDisplay demo.qlab4
Reply all
Reply to author
Forward
0 new messages