Import Group Placeholders with Cue #

150 views
Skip to first unread message

Tom Colburn

unread,
Aug 17, 2023, 2:35:46 PM8/17/23
to ql...@googlegroups.com
Hi all,

This may be covered in this group already, but I haven't found it:

Is there a way to take a spreadsheet that has a column for (script) Line number and another for Title and import that into a list as group cues with the line number in the Number and the Title in the Name columns of the list? 

In essence, creating a show list with groups for each eventual cue, pre-numbered and titled, as placeholders to eventually be filled in with the cue details in the group.

Tom

micpool

unread,
Aug 17, 2023, 2:59:13 PM8/17/23
to QLab
Yes, but....

Which spreadsheet?

Which version of QLab?

Tom Colburn

unread,
Aug 17, 2023, 3:15:06 PM8/17/23
to QLab
QLab 5.2 and I have access to both Excel and Google Sheets, but the file is currently an "Excel 97-2004 Workbook (.xls)" exported from CHSoundDesign.com's "Moves". Am I guessing correctly that ultimately a .cvs file will be what's used?

Tom

Tom Colburn

unread,
Aug 17, 2023, 3:16:07 PM8/17/23
to QLab
.csv 

micpool

unread,
Aug 17, 2023, 6:23:35 PM8/17/23
to QLab

--make group cues from 2 columns  of an open Excel spreadsheet (in excel.app

tell application "Microsoft Excel" to tell active sheet to set theRowCount to ((first row index of (get end cell 99999 of column 1 direction toward the top)))


repeat with eachRow from 1 to theRowCount

tell application "Microsoft Excel" to tell active sheet

set theQnumber to value of cell ("A" & eachRow as text)

set theQname to value of cell ("B" & eachRow as text)

end tell

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

make type "group" --assumes mode and other parameters set in cue template

set theCue to last item of (selected as list)

set the q number of theCue to theQnumber

set the q name of theCue to theQname

end tell

end repeat

Tom Colburn

unread,
Aug 18, 2023, 2:52:04 AM8/18/23
to QLab
Thanks, Mic! This is great! 

I was even able to analyze what you did and add a third column to the notes field.  I'm new to scripting, any resources you can point me towards for learning?

Tom

Tom Colburn

unread,
Aug 18, 2023, 11:34:47 AM8/18/23
to QLab
As a follow up, Mic, I'm trying to expand upon your script. I've gotten as far as creating a Network Cue but am stuck on how to assign the networkPatchName, which in turn keeps me from populating the customString. 

What am I doing wrong? It defaults to LocalQLab.

Tom

Screen Shot 2023-08-18 at 8.26.28 AM.jpgScreen Shot 2023-08-18 at 8.24.24 AM.jpg

micpool

unread,
Aug 18, 2023, 12:00:24 PM8/18/23
to QLab
The clue should be that networkPatchName is in green rather than purple which means it is a variable, not a parameter of a network  cue

As the parameters  q number and  q name are  all lower case with spaces, then even if you didn't look in QLab's Applescript dictionary,  the parameter you wanted to set was most likely network patch name which would have been correct



Mic

Tom Colburn

unread,
Aug 18, 2023, 12:31:07 PM8/18/23
to QLab
Ahhhh! (I'm such a noob to scripting, I had never known the meaning of the colors.) Having accessed QLab's Applescript dictionary to create my first modification, I was re-modifying my previously added third column which happened to be a single word (notes), so didn't catch the distinction of the spaces and case.

Your clue allowed me to fix both on my first attempt!

Many thanks!

Tom

Tom Colburn

unread,
Aug 20, 2023, 1:22:25 PM8/20/23
to QLab
I've successfully modified this to add a network que, but am having troubles with a start cue. I haven't figured out the syntax for setting the target of the start cue.  I have a valid target already in the workspace (and have confirmed it works by manually typing it in), but I get an error running the script, because despite having looked at both the QLab dictionary online and Applescript dictionary for QLab, I apparently don't have the syntax right.
Screen Shot 2023-08-20 at 10.19.42 AM copy.jpg

micpool

unread,
Aug 20, 2023, 1:31:48 PM8/20/23
to QLab

set the cue target of theCue to cue theTarget

Tom Colburn

unread,
Aug 20, 2023, 4:29:09 PM8/20/23
to QLab
Thanks, Mic! ONE...MISSING...WORD!  Following the previous pattern didn't work. How does one know that missing word is needed (besides the obvious "it dosn't work without it!" 😂)?

This has me thinking, (having now successfully learned how to use a spreadsheet to create Group, Network and Start cues, is it possible to add a cue type to the spreadsheet to create a different type cue with each line, and if the cue type is Group, then the following cues, until the next Group cue get imbedded inside the group just created?

Tom

micpool

unread,
Aug 20, 2023, 7:36:13 PM8/20/23
to QLab
On Sunday, August 20, 2023 at 9:29:09 PM UTC+1 powers...@gmail.com wrote:
ONE...MISSING...WORD!  Following the previous pattern didn't work. How does one know that missing word is needed 

Applescript is close to plain language but needs certain conventions to be observed for commands to make sense.

Generally Parameters require values to be in a certain format. e.g. q name expects a string value like "my name".,q number expects a string value as well .

the cue target of a cue needs its value to be a cue, so just as it wouldn't work to say set the cue  target of  3 , instead of set the cue  target of  cue "3", it also  doesn't work to say set the cue  target of cue "3" to 234, instead of set the cue target of cue "3" to cue "234"

You can set a variable to a cue by telling it which cue you are referring to e.g set theSelected  to last item of (selected as list), or by explicitly setting it, e.g set theCue to cue "3".

You can then use, set the cue target of  theSelected to theCue.

Working backwards you could say, return theCue which would  return something like cue id "C4C811E9-DB99-4D3E-887E-AD0BE99F1145" or you could return the q number of theCue which would be "3"
 

This has me thinking, (having now successfully learned how to use a spreadsheet to create Group, Network and Start cues, is it possible to add a cue type to the spreadsheet to create a different type cue with each line, and if the cue type is Group, then the following cues, until the next Group cue get imbedded inside the group just created?

Yes, but this involves a bit of Applescript which is as far from plain language as it is possible to imagine!

-

-read q types from column A of an Excel spreadsheet and put cues inside groups

--first cell of column A must be group


tell application "Microsoft Excel" to tell active sheet to set theRowCount to ((first row index of (get end cell 99999 of column 1 direction toward the top)))


repeat with eachRow from 1 to theRowCount

tell application "Microsoft Excel" to tell active sheet

set theQtype to value of cell ("A" & eachRow as text)

set theQnumber to value of cell ("B" & eachRow as text)

end tell

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

if theQtype is "group" then

make type "group" --assumes mode and other parameters set in cue template

set theGroup to last item of (selected as list)

set the q number of theGroup to theQnumber

else

make type theQtype

set theCue to last item of (selected as list)

set the q number of theCue to theQnumber

set theCueID to uniqueID of theCue

move cue id theCueID of parent of theCue to end of theGroup

end if

end tell

end repeat



You would probably want to add another column to indicate which cues were to be nested, so you could put groups inside groups, or not move non group cues etc. but in the screen recording attached I am just using a spreadsheet with the q types in column A and the cue numbers in column B



Screen Recording 2023-08-21 at 00.32.09.mov
Reply all
Reply to author
Forward
0 new messages