Script to add new cues to a group

73 views
Skip to first unread message

Tom aspley

unread,
Jun 4, 2022, 7:10:16 AM6/4/22
to QLab
Hi All

I'm trying to create a script that makes a couple of MIDI cues as well as a group cue and then puts the MIDI cues into the group.  Ive 2 issues ......

I know how to write a script that puts selected cues into a group, but can't figure out how to make newly made cues move into a group as part of the script that makes them.

Attached is the script I have so far.

Cheers

Tom
script example.qlab4

Sam Kusnetz

unread,
Jun 4, 2022, 11:07:57 AM6/4/22
to ql...@googlegroups.com
The trick is this little bit of scripting alchemy:

  set groupToGoInto to cue “x"
  make type “MIDI"
  set newCue to last item of (selected as list)
  set newCueId to uniqueID of newCue
  set listThatIAmIn to parent of newCue
  move cue id newCueId of listThatIAmIn to end of groupToGoInto

First, we know what Group we want to put the cue into, so we set a variable to identify that Group. Here, it’s a cue numbered “x”

Next, when a new cue is created in QLab, it necessarily becomes the last selected item. Ergo, we can set a variable to capture that cue and find out it’s unique ID.

Next, we set a variable to identify the cue list that the new cue is in, and finally we move it from there to the group.

Enjoy!

Sam
Sam Kusnetz (he/him) | Figure 53



--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
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/9280606c-90c4-47ca-b765-37d3b71f4b21n%40googlegroups.com.

Tom aspley

unread,
Jun 4, 2022, 12:51:33 PM6/4/22
to QLab
Thanks Sam

That worked, only issue was that on the first line,  I couldn't identify the group (as I wanted to make it as part of the same move script).  However changing the first line to 

set groupToGoInto to newcue

After the make  group bit of script means it works a treat

Cheers

Sam Kusnetz

unread,
Jun 4, 2022, 12:59:01 PM6/4/22
to ql...@googlegroups.com
Aha, I somehow missed that you wanted to make the Group as part of the script.

Glad you got it working.

-sk

Sam Kusnetz (he/him) | Figure 53


Reply all
Reply to author
Forward
0 new messages