Applescript to move new cue

578 views
Skip to first unread message

Adam Earle

unread,
Jun 25, 2018, 3:26:59 PM6/25/18
to QLab
What are the syntax options for moving cues? (before, after, beginning, end, anything else? can you say # of cues/items before?)

I've got a script to create a new cue and move it after another cue but I'm getting the following error:

QLab 3 got an error: You cannot move/insert/remove cues referenced from a workspace. Try performing the operation referenced from their enclosing group or cue list instead.

Make block from applescript

 Repeat with targetQ in (selected as list)

make type "Memo"

set newQ to last item of (selected as list)

set properties of newQ to {q name:qName, q number:qNum, continue mode:do_not_continue}

set newCueID to uniqueID of newQ

move cue id newCueID to after targetQ

set continue mode of parent of newQ to auto_continue



I also tried 


move cue id newCueID to after cue targetQ


but got 


QLab 3 got an error: Can’t make cue id "628" of workspace "QLab3 Basic Template v4" into type integer.


Trying cue id TargetQ throws a similar error. Any help on the appropriate syntax would be appreciated.


(The idea here is you select the first cue of every scene and run the script, then you have a memo marking scene breaks but your calling doesn't change.)




Rich Walsh

unread,
Jun 25, 2018, 4:13:19 PM6/25/18
to ql...@googlegroups.com

Personally, I’d move the selection to targetQ before making the Memo Cue – although I can’t immediately remember if the ability to set selected only arrived in v4.

Rich

Adam Earle

unread,
Jun 25, 2018, 5:09:23 PM6/25/18
to QLab
Strangely enough, I'm having no issue moving cues into groups, or creating new cues within groups. My issue simply lies in moving cues within the cue list. If cue # is an OSC cue with the "Scene End" flag in Eos, I want to create a new memo after it(or after the group containing it) that displays scene end, and I want to iterate that if over the entire main cue list. (The script works by parsing an excel documented exported from Eos.)

I tried

move cue id newCueID of parent of newQ to after targetQ


and got this error again.


QLab 3 got an error: You cannot move/insert/remove cues referenced from a workspace. Try performing the operation referenced from their enclosing group or cue list instead.


I seem to be having issues with Qlab looking at the workspace when I want it to be looking at specific cues. I'm pretty new to appescript and am still mostly just modifying other stuff.

Are you suggesting rather than make a list from highlighted cues to use the moveSelectionDown command? I'm unfamiliar with the ability to moveSelection to Target(or similar), I though you only had the option to scroll up and down one cue at a time. 

Here's the pastebin of the whole script since my formatting went wonky above:


Thanks for the reply.

Maik Waschfeld

unread,
Jun 25, 2018, 5:36:03 PM6/25/18
to ql...@googlegroups.com
Hi,

although I can’t immediately remember if the ability to set selected only arrived in v4.

Like:
tell application id "com.figure53.QLab.3"
set the_QLabVersion to version
tell front workspace
— 
set selected to cue "11" -- or whatever cue you want to select
— 
end tell
end tell

Works in QLab v.3.2.14, too.


With kindest regards…
…Maik Waschfeld

(sent from my MBAir11)
also at <mailto:Maik.Wa...@Staatstheater-Stuttgart.de>

Rich Walsh

unread,
Jun 25, 2018, 5:37:38 PM6/25/18
to ql...@googlegroups.com
You can use this form to move the selection (for example):

set selected to cue "1"

A new cue will be inserted after the selection, in the same hierarchy.

This form seems to work for moving a cue within its existing parent:

tell application id "com.figure53.QLab.3"
tell front workspace
make type "Memo"
set newCue to last item of (selected as list)
set newCueID to uniqueID of newCue
tell parent of newCue
move cue id newCueID to after cue "1"
end tell
end tell
end tell

Rich

-- 
Contact support anytime: sup...@figure53.com
Follow Figure 53 on Twitter: https://twitter.com/Figure53
User Group Code of Conduct: https://figure53.com/help/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/38e145f7-8d20-4ae0-b0e3-773e4c96083c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Earle

unread,
Jun 25, 2018, 6:22:24 PM6/25/18
to QLab
Thank you everyone, this was the winning line of code in the end.
 

move cue id newCueID to after cue (q number of targetQ)


The subtlety of cue x versus cue "x" can drive you mad. I spent a lil bit trying escape characters to get the quotes around targetQ, kinda stumbled onto the parenthesis on accident. 
Reply all
Reply to author
Forward
0 new messages