Hi pros,

57 views
Skip to first unread message

Kalman Tarr

unread,
Aug 21, 2026, 7:19:53 AM (12 days ago) Aug 21
to QLab
I have a job; I need to check and change the 'play count' parameters of slices.
I tried to write a script to change them. But it was unsuccessful. 
I show the trial I did. 

set theCue to last item of (selected as list)

set theMarkers to slice markers of theCue

set item (2) of theMarkers to {time:anyValue, playCount:4}

It was unsuccessful.

My last attempt was using the OSC command to set different slice marker parameters.
I wrote a script to show you:

property thePlyCount : 1

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

try

set theCue to last item of (selected as list)

set q number of theCue to "snd"

set theMarkers to slice markers of theCue

log (count of theMarkers)

on error

return

end try

set lastString to "/cue/" & q number of theCue & "/lastSlicePlayCount {" & thePlyCount & "}"


repeat with i from 0 to count of theMarkers

set theString to ("/cue/" & q number of theCue & "/sliceMarker/" & i as text) & "/playCount " & thePlyCount & ""

log theString

do shell script "echo " & the quoted form of (theString) & " | nc -u -w 0 127.0.0.1 53535"

end repeat

do shell script "echo " & the quoted form of (lastString) & " | nc -u -w 0 127.0.0.1 53535"

log "vége"

end tell


This is what works.
Is it possible to write a script that uses the record parameters for the setup?
Thanks in advance.
Best,
Kalman

Rich Walsh

unread,
Aug 21, 2026, 7:44:06 AM (12 days ago) Aug 21
to ql...@googlegroups.com
Hmm.

  1. Why did you post this twice in quick succession?
  2. Why didn’t you use something useful as the subject so that replies to this could be meaningful to other people in the future?

I can’t recreate your issue of the slice markers record showing different information to the QLab UI. Were you looking at two different cues?

As usual, you’ve overcomplicated this instead of looking carefully at the AppleScript dictionary. Slice markers of a cue returns a LIST of slice marker RECORDS, each containing two key:value pairs for time and playCount:

slice marker record n
properties
time (real) : The end time of a slice.
playCount (integer) : The number of times a slice will play. Play count -1 = infinite loop.

I haven’t had much success trying to manipulate items of the slice marker list directly, but it’s pretty trivial to pull the whole list, change it and write it back to the cue:

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

set selectedCue to last item of (selected as list)

set sliceMarkers to slice markers of selectedCue

set playCount of item 2 of sliceMarkers to (playCount of item 2 of sliceMarkers) + 1

set item 1 of sliceMarkers to {time:30, playCount:7}

set slice markers of selectedCue to sliceMarkers

end tell


Rich

On 21 Aug 2026, at 12:10, Kalman Tarr <tarr....@gmail.com> wrote:

I have a job; I need to check and change the 'play count' parameters of slices. I tried to write a script to change them. But it was unsuccessful. I show the trial I did.
First, I tried to read the contents of the slice markers; it worked. But the first element contains a value that I don't understand. (*3, 6.366395950317*) The first element is the play count, the second is the associated time value, of course.
But in the wave image (time & loops), the first slice shows the next play count value: 1. I do not understand the difference between the two values.
The main problem I have is that next, I couldn't create a script that sets the different markers' time and play count parameters. I know slice markers are a record-style value.
I tried using the next command line:
set item (2) of theMarkers to {time:anyValue, playCount:4}
It was unsuccessful.
My last attempt was using the OSC command to set different slice marker parameters.
I wrote a script to show you:

property thePlyCount : 1
tell application id "com.figure53.QLab.5" to tell front workspace
try
set theCue to last item of (selected as list)
set q number of theCue to "snd"
set theMarkers to slice markers of theCue
log (count of theMarkers)
on error
return
end try

set lastString to "/cue/" & q number of theCue & "/lastSlicePlayCount {" & thePlyCount & "}"
repeat with i from 0 to count of theMarkers
set theString to ("/cue/" & q number of theCue & "/sliceMarker/" & i as text) & "/playCount " & thePlyCount & ""
log theString
do shell script "echo " & the quoted form of (theString) & " | nc -u -w 0 127.0.0.1 53535"
end repeat
do shell script "echo " & the quoted form of (lastString) & " | nc -u -w 0 127.0.0.1 53535"
log "vége"
end tell

This is what works. 
Finally my question, is it possible to write a script that uses the record parameters for the setup?

Kalman Tarr

unread,
Aug 21, 2026, 10:56:44 AM (12 days ago) Aug 21
to QLab
You are right again and again, Rich.

I deleted my first comment. It was unnecessarily verbose. It wasn't needed.

I mentioned several times that I am not a scripting expert. That is why I make mistakes. That is the fate of beginners.

I realized where I went wrong. The last line of your code is the key.

set slice markers of selectedCue to sliceMarkers

I didn't think I had to provide that.

Thanks for the great help.
Best,
Kalman
Reply all
Reply to author
Forward
0 new messages