Script Example - Jumpback / rewind cues by x seconds.

169 views
Skip to first unread message

Tim Fox

unread,
Nov 14, 2023, 8:46:30 PM11/14/23
to QLab
Folks,
f53 support helped with a script to address a requirement I had. (Thanks folks!) 

Typical scenario I get is:
-  in a rehearsal for an end of year dance recital, we pause running audio, the teachers will give, er, "in-the-moment feedback to the dancers', 
- then ask to restart the audio from a few bars back from where we stopped so the kids can pick up the dance again and continue the rehearsal
- rinse / repeat till we run out of rehearsal time ¯\_(ツ)_/¯ 

f53 provided a script that ran on the selected cue, but I wanted a shortcut to act on any active cue (paused or not), so I extended it.

Here's the the script. I've tested a bit and it seems OK, but happy for any feedback or insights.

Thought it might be useful for the group.

Couple of notes:
- The first line sets the amount of seconds to rewind. 10 secs feels about right. Put it on a hotkey and execute it multiple times to kangaroo your way back the start of each cue if you'd like
- active cues are temporarily paused, rewound, and then restarted to get them to accept an updated loadtime. Paused cues didnt need this
- prewait times seem to mess with the 'paused time', so that's why it's in the calculation
- Seem to pick up their original geometry (vol / opacity). So if you start at 0% and have a fade cue to lift that to 100%, there may be some more work to do. 

Cheers!


set jumpBack to 10

tell application id "com.figure53.QLab.5" to tell front workspace
   
    set activeCues to active cues
   
    if (count activeCues) is greater than 0 then
        repeat with eachCue in activeCues
            if q type of eachCue is "Audio" or q type of eachCue is "Video" or q type of eachCue is "Fade" then
               
                if paused of eachCue is true then
                    set pausedTime to action elapsed of eachCue
                    set prewaitTime to pre wait of eachCue
                    set loadTime to (pausedTime - jumpBack + prewaitTime)
                    if loadTime is less than 0 then
                        set loadTime to 0
                    end if
                    load eachCue time loadTime
                else
                    pause eachCue
                    set pausedTime to action elapsed of eachCue
                    set prewaitTime to pre wait of eachCue
                    set loadTime to (pausedTime - jumpBack + prewaitTime)
                    if loadTime is less than 0 then
                        set loadTime to 0
                    end if
                    load eachCue time loadTime
                    start eachCue
                end if
            end if
        end repeat
    end if
end tell




Johan

unread,
Nov 17, 2023, 5:34:06 PM11/17/23
to QLab
Thanks!
That sure can be useful every once and a while.
Reply all
Reply to author
Forward
0 new messages