Increment target with script

66 views
Skip to the first unread message

Bru

unread,
20 Sept 2022, 12:08:2720/09/2022
to QLab
Hi 
I'm pretty new in Qlab scripting. 
I want to increment a cue target (let's say cue 62) of a start cue every time the script is fired into a loop.
Here is what I've done:

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

   set targetnumber to q number of cue target of cue "62"

   set targetplusone to targetnumber + 1

   display dialog targetplusone

   set cue target of cue "62" to cue targetplusone  

end tell

I can display the right value but the target seems to be the ID number of the cue but I need to target to the q number. 
Any help?
thanks

Taylor Glad

unread,
21 Sept 2022, 01:17:0421/09/2022
to QLab
Instead of using cue target, I would just increment the number, and use "as string" inside parenthesis with the variable as shown.
(This script is just enough to get the point across)

tell application id "com.figure53.QLab.4" to tell front workspace
    set targetnumber to 62
    set targetnumber to targetnumber + 1
    display dialog targetnumber
    set cue target of cue "62" to cue (targetnumber as string)
end tell

Bru

unread,
21 Sept 2022, 05:54:0321/09/2022
to QLab
Perfect!!! Thanks!

Rich Walsh

unread,
21 Sept 2022, 18:43:4121/09/2022
to ql...@googlegroups.com
The important bit of this is that…

cue 7

…is not the same as…

cue “7"

The first is the seventh cue in whatever container you are addressing – below, it's the front workspace. The second is the cue whose cue number is the text string “7”.

To refer to a cue by its cue number rather than its position inside another object you have to explicitly coerce calculated numbers to text.

A cue’s “ID” is much more exciting and takes a form like "004E3D1E-0A9A-4372-ADF3-216506677005”.

Rich
Reply all
Reply to author
Forward
0 new messages