[QLab] Useful scripts?

4,569 views
Skip to first unread message

Rich Walsh

unread,
Sep 5, 2009, 2:26:35 PM9/5/09
to Discussion and support for QLab users.
I am fascinated by AppleScript but tend to bumble my way through it adjusting things until they work, rather than feeling that I actually get it.

I played around with Chris's fade script and came up with this, which fades out in 5s and stops the cue - and also gives the new cue a name:

tell application "QLab"
set originalCue to last item of (selected of workspace 1 as list)
if q type of originalCue is "Audio" then
tell workspace 1
make type "Fade"
set newCue to last item of (selected as list)
set cue target of newCue to originalCue
set duration of newCue to 5
newCue setLevel row 0 column 0 db -120
set stop target when loop ends of newCue to true
set q name of newCue to "Fade out " & q name of originalCue
end tell
end if
end tell

These are pretty obvious simple scripts to bump the master level of the selected audio cue(s) up/down 2.5dB; they can of course be adjusted to taste:

tell application "QLab"
set theSelection to selected of workspace 1
repeat with eachCue in theSelection
if q type of eachCue is "Audio" then
tell workspace 1
set currentLevel to eachCue getLevel row 0 column 0
set newLevel to currentLevel + 2.5
eachCue setLevel row 0 column 0 db newLevel
end tell
end if
end repeat
end tell

tell application "QLab"
set theSelection to selected of workspace 1
repeat with eachCue in theSelection
if q type of eachCue is "Audio" then
tell workspace 1
set currentLevel to eachCue getLevel row 0 column 0
set newLevel to currentLevel - 2.5
eachCue setLevel row 0 column 0 db newLevel
end tell
end if
end repeat
end tell

Would these be more useful in practice if applied to the "Trim" tab rather than the "Levels"? I'm not sure that's possible though.

I can't work out how to change the currently viewed cue list though: "set current cue list of workspace 1 to 1" results in an error. What have I missed here?

I'd love to try to write some more, but can't think of any I might need yet. Any ideas?

Thanks.

Rich

Christopher Ashworth

unread,
Sep 5, 2009, 3:05:26 PM9/5/09
to Discussion and support for QLab users.
Very nice Rich!

One question: did you mean to use the "stop target when done" property
instead of the "stop target when loop ends" property? (The latter is
for the devamp cue.)

I think it would be fantastic if we started a collection of these
scripts on the Wiki. Anyone willing to get us started by creating a
new "Scripts & Macros" page?

http://figure53.com/wiki/

Regarding setting a cue list, you'll need to pass in an actual cue
list, rather than a number.

Cheers,
Chris

________________________________________________________
WHEN REPLYING, PLEASE QUOTE ONLY WHAT YOU NEED. Thanks!
Change your preferences or unsubscribe here:
http://lists.figure53.com/listinfo.cgi/qlab-figure53.com

Rich Walsh

unread,
Sep 5, 2009, 4:17:43 PM9/5/09
to Discussion and support for QLab users.
On 5 Sep 2009, at 20:05, Christopher Ashworth wrote:

> One question: did you mean to use the "stop target when done"
> property instead of the "stop target when loop ends" property? (The
> latter is for the devamp cue.)

If you type "stop target when done" it gets changed to "stop target
when loop ends" when you compile it...

> I think it would be fantastic if we started a collection of these
> scripts on the Wiki. Anyone willing to get us started by creating a
> new "Scripts & Macros" page?
>
> http://figure53.com/wiki/
>
> Regarding setting a cue list, you'll need to pass in an actual cue
> list, rather than a number.

I think I tried that:

tell application "QLab"
set current cue list of workspace 1 to "Main Cue List"
end tell

Results in 'Can't make "Main Cue List" into type cue list' error.

I'm going to have another look at the bump script to get it to bump
fade cues too. If you have a sequence of play, fade in, fade down,
fade out, would the best way to change the overall level be to adjust
the Trim levels in the audio cue?

sam kusnetz

unread,
Sep 5, 2009, 4:23:35 PM9/5/09
to ql...@lists.figure53.com

this whole combination of the script cue and being able to access the
currently selected cue is such a powerhouse.

i have created a section on the qlab wiki to collect useful scripts
and script snippets. i think we should all pool our knowledge there. i
myself am working on a script which confirms that the screen saver,
energy saver, and sound preferences are set the way i like them before
running a show... sort of a pre-show computer check. i will post it
there once it's done.

way to go, chris, for adding these killer features, and way to go
everyone else for jumping in and sharing your spiffy ideas.

cheerio
sam
--
there can be hours between the so and the what of the so
http://www.notquite.net

Rory Dale

unread,
Sep 5, 2009, 4:41:15 PM9/5/09
to Discussion and support for QLab users.
I'm seriously considering having AppleScript give the pre-show
backstage time calls, triggered by wall clock. But what voice to
use... :)

say "Thirty minutes til places."

David Bibby

unread,
Sep 5, 2009, 4:49:37 PM9/5/09
to Discussion and support for QLab users.
On 5 Sep 2009, at 21:17, Rich Walsh wrote:

> tell application "QLab"
> set current cue list of workspace 1 to "Main Cue List"
> end tell
>
> Results in 'Can't make "Main Cue List" into type cue list' error.

To use the cue list's name the following should work:

tell application "QLab"
set the current cue list of workspace 1 to the first cue list in
workspace 1 whose q name is "Cue List 3"
end tell

or to use it's number try:

tell application "QLab"
set current cue list of workspace 1 to cue list 1 of workspace 1
end tell


Cheers,
David

Christopher Ashworth

unread,
Sep 5, 2009, 4:56:29 PM9/5/09
to Discussion and support for QLab users.
On Sep 5, 2009, at 4:17 PM, Rich Walsh wrote:

> On 5 Sep 2009, at 20:05, Christopher Ashworth wrote:
>
>> One question: did you mean to use the "stop target when done"
>> property instead of the "stop target when loop ends" property?
>> (The latter is for the devamp cue.)
>
> If you type "stop target when done" it gets changed to "stop target
> when loop ends" when you compile it...

Ah, this is my fault then; I must have used the same AppleScript code
for both parameters. I'll fix this.

>> I think it would be fantastic if we started a collection of these
>> scripts on the Wiki. Anyone willing to get us started by creating
>> a new "Scripts & Macros" page?
>>
>> http://figure53.com/wiki/
>>
>> Regarding setting a cue list, you'll need to pass in an actual cue
>> list, rather than a number.
>
> I think I tried that:
>
> tell application "QLab"
> set current cue list of workspace 1 to "Main Cue List"
> end tell
>
> Results in 'Can't make "Main Cue List" into type cue list' error.

This is the name of the cue list, but it is not the actual cue list
itself. (See David's previous post for how to set the cue list.)

> I'm going to have another look at the bump script to get it to bump
> fade cues too. If you have a sequence of play, fade in, fade down,
> fade out, would the best way to change the overall level be to
> adjust the Trim levels in the audio cue?

Yes, although there is not currently scripting access to the trim. I
can add that too.

-C

Rich Walsh

unread,
Sep 5, 2009, 5:54:00 PM9/5/09
to Discussion and support for QLab users.
On 5 Sep 2009, at 21:49, David Bibby wrote:

> tell application "QLab"


> set the current cue list of workspace 1 to the first cue list in
> workspace 1 whose q name is "Cue List 3"
> end tell

That did it: thank you! One little bug though: the highlighted cue
list in the Cue List drawer doesn't change to match the displayed cue
list when you use a script...

Rich

Rich Walsh

unread,
Sep 5, 2009, 6:11:29 PM9/5/09
to Discussion and support for QLab users.
On 5 Sep 2009, at 21:17, Rich Walsh wrote:

> I'm going to have another look at the bump script to get it to bump
> fade cues too.

That was actually really easy (like everything in QLab!):

-- Level bump macro


tell application "QLab"
set theSelection to selected of workspace 1
repeat with eachCue in theSelection

if q type of eachCue is "Audio" or q type of eachCue is "Fade" then


tell workspace 1
set currentLevel to eachCue getLevel row 0 column 0

set newLevel to currentLevel + 2.5 -- Change this number to adjust
bump size


eachCue setLevel row 0 column 0 db newLevel
end tell
end if
end repeat
end tell

Rich

Dave Tosti-Lane

unread,
Sep 5, 2009, 6:17:53 PM9/5/09
to Discussion and support for QLab users.
I think I must be missing something dead simple and stupid - I've not really
done much with applescript before.
When I copy the script examples and paste them into the Applescript box in
the script cue, I always get compile errors that say "expected end of line
but got number"
Could this be because of the cut and paste? Do I need to type them in so as
to have the hard returns perhaps? (well, I tried that and got the same
result)

I tried pasting them into the Apple Script editor and got the same thing.
(with the editor highlighting the number at the end of the first line ending
with " selected of workspace 1")

Thanks -
Dave Tosti-Lane

On SaturdaySep/5,SaturdaySep/5:156 PM 1:56 PM, "Christopher Ashworth"

Christopher Ashworth

unread,
Sep 5, 2009, 7:21:54 PM9/5/09
to Discussion and support for QLab users.
Hi Dave,

One thing this could be is if you have changed the name of your QLab
application icon you'll need to edit the name in the script as well.

Or it might be something completely different. Unfortunately, I find
that when one is writing AppleScripts one spends a lot of time
stumbling around in the dark. :/

-C

On Sep 5, 2009, at 6:17 PM, Dave Tosti-Lane wrote:

> I think I must be missing something dead simple and stupid - I've
> not really
> done much with applescript before.
> When I copy the script examples and paste them into the Applescript
> box in
> the script cue, I always get compile errors that say "expected end
> of line
> but got number"
> Could this be because of the cut and paste? Do I need to type them
> in so as
> to have the hard returns perhaps? (well, I tried that and got the same
> result)
>
> I tried pasting them into the Apple Script editor and got the same
> thing.
> (with the editor highlighting the number at the end of the first
> line ending
> with " selected of workspace 1")
>
> Thanks -
> Dave Tosti-Lane

________________________________________________________

Dave Tosti-Lane

unread,
Sep 5, 2009, 7:26:34 PM9/5/09
to Discussion and support for QLab users.
BINGO!

I'd totally forgotten that I had renamed it "QLab2" back when I first
upgraded so I could have both 1 and 2 in the dock and distinguish between
them!

Modified that in the script and everything works like a charm.

Thanks Chris.

Dave


On SaturdaySep/5,SaturdaySep/5:421 PM 4:21 PM, "Christopher Ashworth"

Reid Loessberg

unread,
Sep 27, 2013, 5:24:54 PM9/27/13
to ql...@googlegroups.com, Discussion and support for QLab users.
Possibly a similar item to the bump levels script. I'd like a script (or other method) of bumping levels of a specific set of cues, not the entire cue list.

Rich Walsh

unread,
Sep 27, 2013, 5:27:00 PM9/27/13
to ql...@googlegroups.com
Uh? Almost all of the scripts at http://wiki.figure53.com/QLab+Scripts+and+Macros act on _selected_ cues, not entire cue lists…

Rich

--
--
Change your preferences or unsubscribe here:
http://groups.google.com/group/qlab
 
Follow Figure 53 on Twitter: http://twitter.com/Figure53
 
---
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reid Loessberg

unread,
Sep 27, 2013, 5:40:38 PM9/27/13
to ql...@googlegroups.com
Right, though you need to select the cues individually. EG: the bump levels cue adjusts the entire workspace, and the Add/Subtract Levels requires you select the cues. 

I'd like to adjust a certain set of cues (such cue D, G, H, M, etc) repeatably. 

The specific situation is a set of mic on/off cues that I would like to be able to bump levels via hotkey on just those cues.

So I guess not "selected cues," more like a repeatable set of cues.

Dave "luckydave" Memory

unread,
Sep 27, 2013, 5:41:53 PM9/27/13
to ql...@googlegroups.com
On Friday, September 27, 2013 at 5:40 PM, Reid Loessberg wrote:
The specific situation is a set of mic on/off cues that I would like to be able to bump levels via hotkey on just those cues.

Why not give them all the same hotkey trigger? One for the mute, one for the open.

-- 

Reid Loessberg

unread,
Sep 27, 2013, 5:42:22 PM9/27/13
to ql...@googlegroups.com
Sorry, the level bump (which you made) seems to be just selected cues. Can that one be adjusted to apply to a set of cues?


On Friday, September 27, 2013 2:27:00 PM UTC-7, Rich Walsh wrote:

Reid Loessberg

unread,
Sep 27, 2013, 5:43:53 PM9/27/13
to ql...@googlegroups.com
I like that. But how can I adjust the levels? A dB up or down.

Dave "luckydave" Memory

unread,
Sep 27, 2013, 5:44:39 PM9/27/13
to ql...@googlegroups.com
On Friday, September 27, 2013 at 5:43 PM, Reid Loessberg wrote:
I like that. But how can I adjust the levels? A dB up or down.

Relative fade cues adjust by a specific amount, so there you go.

Reid Loessberg

unread,
Sep 27, 2013, 5:50:37 PM9/27/13
to ql...@googlegroups.com
Ah! Relative as opposed to absolute. So it adjusts it from where-ever it is by however much i set the fade cue to do?!

Rich Walsh

unread,
Sep 27, 2013, 5:54:06 PM9/27/13
to ql...@googlegroups.com
On 27 Sep 2013, at 22:42, Reid Loessberg <rlfo...@gmail.com> wrote:

Sorry, the level bump (which you made) seems to be just selected cues. Can that one be adjusted to apply to a set of cues?

You can write a script to act on anything you want. If you need to iterate through a set of cues – rather than "selected" – then you'll need to find a way of identifying them and then make a list. Cue number is the simplest way, eg:

set userListOfCues to {"cat", "badger", "dog", "aardvark", "1", "2", "3", "etc"} -- ie: a list of cue numbers


tell front workspace
repeat with eachCue in userListOfCues
-- do something to eachCue
end repeat
end tell

Rich

Phil Manson

unread,
Nov 11, 2016, 5:17:52 AM11/11/16
to QLab, ql...@lists.figure53.com
Hi there,

I am looking at this APPLESCRIPT below which looks like a useful way of selecting multiple items 

However, it only works really well for me when I can name all of the cues directly.

Is there a way therefore of SELECTING all cues with in a GROUP CUE for example

I am thinking of having a GROUP CUE with all my AUDIO FILES in for a simple playback workspace but was thinking that there might be a way of DUCKING all cues within this group.

Have reached a bit of a lull

Any help, gladly appreciated

PHIL

micpool

unread,
Nov 11, 2016, 5:56:35 AM11/11/16
to QLab, ql...@lists.figure53.com
Thanks for reviving this old thread. I feel very nostalgic reading the earlier posts in it from 2009!

It may well be that what you are trying to achieve is readily do-able without any scripting.

A cue list is a group cue anyway so you can use relative fades to duck and restore the level of an entire cue list.

If you are ducking under recorded announcements then put those in a seperate cue list and use start cues from the main list to trigger them.

If you describe what it is you want to do then I am sure there is probably an easy way to do it.

Mic

Phil Manson

unread,
Nov 11, 2016, 8:00:06 AM11/11/16
to QLab, ql...@lists.figure53.com
Hi there,

Yep, appreciate its an nice old thread, but still really valid and good to still have access to......

I am slowly teaching myself the ins and outs of script within QLab, mainly down to the great examples that you and others are sharing n here.

Most of it is slowly making sense, but then I come up against a brick wall :)

What I am trying to do is roughly as follows :

I have set up 2 x Group Audio Folders

1 has AWARDS STINGS in and the other has GENERIC WALK UPS

I have managed to set up cues that can trigger a random file from each of the groups on 2 hotkeys, and then once a cue has played, it os labelled as unavailable, so that stings aren't repeated.

What I am trying to do now is have a hot key that will allow to DUCK the volume of any cue that is playing within the AWARDS STING by say -10, and then another CUE that triggers it back up to ZERO again on the main FADERS

I have set up CUES but can only seem to find a way to do it to SELECTED cues which is a bit fiddly as my folder has some 100 plus stings and when they are triggered randomly, I have to then locate the file.

I like the idea of using separate cue lists - hadn't thought of this - and can these therefore be treated as ONE CUE and as such have volume changes applied across the board on any cues within that LIST ?

Any advice or pointers would be greatly appreciated as ever

ATB

Phil

micpool

unread,
Nov 11, 2016, 8:18:21 AM11/11/16
to QLab, ql...@lists.figure53.com
All you need to do is use 2 fade cues with assigned hotkeys targeting your Awards Stings group

Set the  DUCK  fade cue to apply a relative fade of -10dB  probably in something like .5 secs

Set the  RESTORE fade cue to  apply a relative fade of +10dB in something like 2-3s

Bear in mind that these will only affect cues that are running or loaded. So if you were to DUCK a cue then play another cue in the awards sting group before RESTORE,  the second cue would play at the normal volume and then when you restored would increase by 10dB;  i.e if you don't RESTORE a ducked cue while it is playing you do not need to RESTORE when it is stopped. The next cue (unless it was loaded when the DUCK cue was triggered) will play at the normal volume.



Mic

Phil Manson

unread,
Nov 11, 2016, 8:37:18 AM11/11/16
to QLab, ql...@lists.figure53.com
Yep

Went down the 2 x VUE LIST approach, and works a treat!!!

Really useful and I have put my CUE SELECTION and RANDOMNESS in the CONTROL LIST as well

All now controlled from my Wii Remote to make for a lovely sit back rehearsal!

Thanks again

PHIL


file:///Users/macbookretina/Desktop/Screen%20Shot%202016-11-11%20at%2013.36.59.png

Rich Walsh

unread,
Nov 11, 2016, 6:52:40 PM11/11/16
to ql...@googlegroups.com
I’ve written a handful of scripts since these very, very first ones… You might learn something useful here: https://groups.google.com/d/topic/qlab/8alVV7-MJ8w/discussion. All the scripts are in the Word file, and I think there’s probably an example in there of every trick I know.

For example, you don’t need to select cues to address them – you can address them as cue “1” or cue id 1 or first cue whose running is true or last item of (active cues as list) or cues of cue “1”, and so on.

Rich

talkingtobrian

unread,
Nov 15, 2016, 9:55:21 PM11/15/16
to QLab, ql...@lists.figure53.com
I am actually about to publish a blog on the things I have learned and scripted in Qlab. Applescript, tricks, and even things are not directly Qlab but usually end up circling back there since my entire production environment revolves around this program, even when I'm coming in as overhire. I've learned so much from the community here, which has allowed me to do a lot of research and development on my own as well. Looking forward to sharing it with everyone, and getting feedback!

-brian
Reply all
Reply to author
Forward
0 new messages