AppleScript calling cues name

120 views
Skip to first unread message

sprsndman

unread,
Nov 9, 2020, 7:14:00 PM11/9/20
to QLab
Hello,
is it possible for AppleScript to get the calling script cues name?

I've been searching and messing around trying to figure this out, and coming up short...

I'm trying to create a script that can log times to a file, that's all well and good, but having to edit the script cue each time is a tad annoying, especially since what I want it to log is it's own name.

Thanks!

micpool

unread,
Nov 9, 2020, 7:23:40 PM11/9/20
to QLab
tell application id "com.figure53.QLab.4" to tell front workspace
set mycue to last item of (cues whose running is true and q type is "Script")
set cuename to q name of mycue
end tell

sprsndman

unread,
Nov 9, 2020, 7:28:52 PM11/9/20
to QLab
Oh man.... don't I feel dumb. I never thought to filter running cues like that.

Thank you greatly!

micpool

unread,
Nov 9, 2020, 8:19:50 PM11/9/20
to QLab
Don't feel dumb, Rich Walsh did the work to come up with the basis for this script  a few years ago, and until then we had all been scratching our heads for months  working out how to get a script cue to reliably reference itself.

Mic

m...@stevensokulski.com

unread,
Nov 10, 2020, 5:48:26 PM11/10/20
to QLab
One small thing to be aware of using this method:

If you call more than one Script cue at the same time, all of them will read the cue attributes of the last one to be called. If you need to use more than one Script cue at the same time, you might have to introduce a short pre-wait to accommodate.

micpool

unread,
Nov 10, 2020, 7:07:24 PM11/10/20
to QLab
On Tuesday, November 10, 2020 at 10:48:26 PM UTC steven wrote:
One small thing to be aware of using this method:

If you call more than one Script cue at the same time, all of them will read the cue attributes of the last one to be called. If you need to use more than one Script cue at the same time, you might have to introduce a short pre-wait to accommodate.


I don't think that is necessarily so.

If you want to control the order and timing of the execution of script cues, you need to leave the run in separate process box unchecked. If you do that you can run loads of scripts in a timeline group with 0 pre-wait and they will all correctly identify the calling cue. 

Mic

João Hora

unread,
Nov 11, 2020, 3:14:52 AM11/11/20
to ql...@googlegroups.com
Sorry to bug you guys.

Is there any chance to call script cuenames from upcoming cues instead of the running cue only?
I want to do something that will “predict” the next action.

Best



No dia 10/11/2020, às 00:23, micpool <m...@micpool.com> escreveu:


--
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/f0df9f48-f1ce-4509-ab1e-1f45f6bb309an%40googlegroups.com.
Message has been deleted

micpool

unread,
Nov 11, 2020, 7:53:34 AM11/11/20
to QLab
Sorry, I confused my playhead and playback position in the last post!


It should have read:



if your playhead is locked to the selection

Set thecue to last item of (selected as list)

If not

set thecue to playback position of first cue list whose q name is "Main Cue List" --change to name of your cue list

Adjacent cues can then be referenced with

Set thenextcue to cue after thecue

Set theprevcue to cue before thecue

Mic

 
Mic

João Hora

unread,
Nov 13, 2020, 3:16:56 PM11/13/20
to ql...@googlegroups.com
Great!!! thanks Mic!

Reply all
Reply to author
Forward
0 new messages