Using Apple Script to set slice times

218 views
Skip to first unread message

ben.sti...@gmail.com

unread,
Apr 26, 2018, 9:24:19 PM4/26/18
to QLab
Hello All

Attempting to use an apple script yo set the time points of slice times and seeming to run into a brick wall I keep getting the error code :
"QLab got an error: Can’t set slice marker record 1 of cue "VIDEO1" of workspace 1 to "2.54"."

Am using Q lab 4.2.3

Code:
using terms from application "QLab"

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

tell slice marker record 1 of cue "VIDEO1"

set time to "2.54"

end tell

end tell

end using terms from


I am guessing that its one of the below :

  • using the wrong format for the time 
  • not correctly targeting the slice marker record 
  • I am trying to do something Q lab can't do 

Cheers, 
Ben 

Slice time test.qlab4

micpool

unread,
Apr 27, 2018, 2:33:20 AM4/27/18
to QLab
Use OSC instead

e.g

/cue/VIDEO1/addSliceMarker 2.54

Mic

micpool

unread,
Apr 27, 2018, 2:44:52 AM4/27/18
to QLab
Or if you need to calculate the time or get it from somewhere else  use something like this script

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

set markertime to 2.54

set oscCmd to "/cue/VIDEO1/addSliceMarker " & (markertime as string)

do shell script "echo " & oscCmd & " | nc -u -w 0 127.0.0.1 53535"

end tell


Mic


On Friday, April 27, 2018 at 2:24:19 AM UTC+1, ben.sti...@gmail.com wrote:

Rich Walsh

unread,
Apr 27, 2018, 4:24:50 AM4/27/18
to ql...@googlegroups.com
The AS form is like this:

tell front workspace
set selectedCue to last item of (selected as list)
set sliceMarkers to slice markers of selectedCue
if (count sliceMarkers) is 0 then -- No existing slices
set sliceMarkers to {{time:123.4, playCount:1}}
else
set item 1 of sliceMarkers to {time:123.4, playCount:1}
end if
set slice markers of selectedCue to sliceMarkers
end tell

Records are a bit weird to work with. playCount  of -1 for infinite loop. You’ll need to dress the code up a bit to fit your context.

Rich

-- 
Contact support anytime: sup...@figure53.com
Follow Figure 53 on Twitter: https://twitter.com/Figure53
User Group Code of Conduct: https://figure53.com/help/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/edd20138-fb40-4ecd-bf92-b0afbfed2419%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ben.sti...@gmail.com

unread,
Apr 30, 2018, 8:30:12 AM4/30/18
to QLab
Thank you both that is exceedingly helpful and now I know that you have to write it back to Qlab a a list make a lot more sense. 
Message has been deleted

David Cherrie

unread,
Aug 9, 2018, 10:25:41 PM8/9/18
to QLab
Hey Rich,

I'm using the following AppleScript but getting the following error: "Invalid slice marker time"

using terms from application "QLab"

tell application "QLab" to tell front workspace

set last slice infinite loop of cue "LOGO-BG" to true

set OldSlice to slice markers of cue "LOGO-BG"

set NewSlice to {{playCount:1, time:8.0}}

set slice markers of cue "LOGO-BG" to NewSlice

ben.sti...@gmail.com

unread,
Aug 10, 2018, 5:47:40 PM8/10/18
to QLab
Hi DC,

I have been having a play around with this and I think the issue might be that the cue needs audio for it to work, so far when I tired that script the first few times it ran perfectly fine no issues. I then swapped the same cue for a vidoe with no audio and got that error. 

Possibly its some way Qlab handles loops requires audio when setting slice markers via apple script ?
Reply all
Reply to author
Forward
0 new messages