Qlab 4: Script for load-to-time?

116 views
Skip to first unread message

Markus Grandegger

unread,
Sep 21, 2023, 8:52:42 PM9/21/23
to QLab
Dear Qlab Masters,

I'm working on a script and cannot make the last piece of it:

Status:
Executing the script the user gets asked which bar (Takt) of the cue should be played. After entering the desired bar the script answers with the correct timecode (referring to a list inside the script) that this bar has in the song and that this time is going to be loaded now.
Well, I can't figure out any commands that will do that for me.

Here is the script so far:
--
set taktListe to {{"00:00:06:00", "1"}, {"00:00:08:12", "2"}, {"00:00:11:00", "3"}, {"00:00:13:12", "4"}}
set userTakt to text returned of (display dialog "Welchen Takt möchtest du laden?" default answer "")
set gefunden to false

repeat with eintrag in taktListe
if item 2 of eintrag is userTakt then
set timecodeOriginal to item 1 of eintrag
set mm to text 4 thru 5 of timecodeOriginal
set ss to text 7 thru 8 of timecodeOriginal
set zz to text 10 thru 11 of timecodeOriginal
set konvertierteSekunden to ((mm * 60) + ss) & "." & zz
set gefunden to true
exit repeat
end if
end repeat

if gefunden then
display dialog "Timecode " & konvertierteSekunden & " wird geladen."

tell application id "com.figure53.QLab.4" to tell front workspace
set currentCue to selected of cue id "3000"
do shell script "loadAtTime " & quoted form of konvertierteSekunden
end tell

else
display dialog "Takt nicht gefunden."
end if
--

Does anybody know how to make the loadAtTime working?
The cue that should be loaded into is just the selected one, and the cue id refers to the cue list ID which is 3000. I tried to install oscsend, but it didn't work on my system (Ventura). If someone here could think of a solution I'd be grateful..

Kindest regards,
Markus

micpool

unread,
Sep 21, 2023, 9:05:49 PM9/21/23
to QLab

set taktListe to {{"00:00:06:00", "1"}, {"00:00:08:12", "2"}, {"00:00:11:00", "3"}, {"00:00:13:12", "4"}}

set userTakt to text returned of (display dialog "Welchen Takt möchtest du laden?" default answer "")

set gefunden to false


repeat with eintrag in taktListe

if item 2 of eintrag is userTakt then

set timecodeOriginal to item 1 of eintrag

set mm to text 4 thru 5 of timecodeOriginal

set ss to text 7 thru 8 of timecodeOriginal

set zz to text 10 thru 11 of timecodeOriginal

set konvertierteSekunden to ((mm * 60) + ss) + (zz / 100)

set gefunden to true

exit repeat

end if

end repeat


if gefunden then

display dialog "Timecode " & konvertierteSekunden & " wird geladen."

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

set currentCue to last item of (selected as list)

load (currentCue) time konvertierteSekunden

end tell

else

display dialog "Takt nicht gefunden."

end if


micpool

unread,
Sep 21, 2023, 9:09:47 PM9/21/23
to QLab
In action
Screen Recording 2023-09-22 at 02.08.00.mov

Markus Grandegger

unread,
Sep 21, 2023, 9:17:56 PM9/21/23
to QLab
Wooohow Micpool THANK YOU SO MUCH!
I've been devastated and You lifted me up, so glad to see it working finally! :)))

Markus Grandegger

unread,
Sep 21, 2023, 9:50:59 PM9/21/23
to QLab
May I be so rude and ask for even more?

I will have 30 cues (numbered 3001-3030), meaning 30x sth like "{{"00:00:06:00", "1"}, {"00:00:08:12", "2"}} etc.",
so I'd like to feed the script with all the 30 bar lists (taktListen). When firing the script I'd need..

it to recognize the actually selected cue from the cue list named "MD Zuspielungen", which has the cue list number 3000,
and take the timecodes according to the correct taktListe.

Would that be possible with only one script?

However, THANKS AGAIN, You saved my day ähem night! :)

micpool

unread,
Sep 21, 2023, 10:55:21 PM9/21/23
to QLab
Why not simplify the whole thing
Put your timecodes for each bar as a separate line in the notes of the cues to which they refer.
Use this script

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

set currentCue to last item of (selected as list)

set taktListe to (notes of currentCue as text)

set takListe_N to q number of currentCue

set userTakt to text returned of (display dialog "Welchen Takt möchtest du laden?" default answer "")

set gefunden to false

set timecodeOriginal to paragraph userTakt of taktListe

set mm to text 4 thru 5 of timecodeOriginal

set ss to text 7 thru 8 of timecodeOriginal

set zz to text 10 thru 11 of timecodeOriginal

set konvertierteSekunden to ((mm * 60) + ss) + (zz / 100)

set gefunden to true

if gefunden then

display dialog "Cue " & takListe_N & " Timecode " & konvertierteSekunden & " wird geladen."

load (currentCue) time konvertierteSekunden

else

display dialog "Takt nicht gefunden."

end if

end tell


(“selected" only returns from current cue list so you can't get the selected of a cue list that is not frontmost)
Screen Recording 2023-09-22 at 03.51.53.mov
Message has been deleted

Markus Grandegger

unread,
Sep 22, 2023, 4:16:26 AM9/22/23
to QLab
That's so great, I can't Thank You enough.. THX THX THX! :)

micpool

unread,
Sep 22, 2023, 7:40:58 AM9/22/23
to QLab
If you did still want to search for the bar number you can put the bar number <tab> timecode  on each line of the notes of the audio cue.

The script would then be

set theTids to AppleScript's text item delimiters

set AppleScript's text item delimiters to tab

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

set currentCue to last item of (selected as list)

set taktListe to (notes of currentCue as text)

set takListe_N to q number of currentCue

set userTakt to text returned of (display dialog "Welchen Takt möchtest du laden?" default answer "")

set gefunden to false

repeat with i from 1 to (count of paragraphs of taktListe)

set theBar to text item 1 of paragraph i of taktListe

if theBar is userTakt then

set timecodeOriginal to text item 2 of paragraph i of taktListe

set mm to text 4 thru 5 of timecodeOriginal

set ss to text 7 thru 8 of timecodeOriginal

set zz to text 10 thru 11 of timecodeOriginal

set konvertierteSekunden to ((mm * 60) + ss) + (zz / 100)

set gefunden to true

exit repeat

end if

end repeat

if gefunden then

display dialog "Cue " & takListe_N & " Takt " & theBar & " Timecode " & konvertierteSekunden & " wird geladen."

load (currentCue) time konvertierteSekunden

else

display dialog "Takt nicht gefunden."

end if

end tell



As in the attached screen recording
Screen Recording 2023-09-22 at 12.38.52.mov

Markus Grandegger

unread,
Sep 27, 2023, 3:23:14 AM9/27/23
to QLab
Thank You Mic!
 
I had already been putting together the timecode-lists for the first version, but will definitely keep that one in store for later use... :)
Reply all
Reply to author
Forward
0 new messages