When I run this program in QLAB5, it does not work. Please help.
--This script requires a network cue numbered "DETECT" sending the following OSC message at 30 fps for a duration of 10 s to port 53000 on localhost
-- /cue/RMS/postWait #/cue/selected/liveAverageLevel/1 0 1#
--This script requires a memo cue numbered "RMS" to store the current sound level
set threshold to 0.005 --detect threshold value between 0 and 1
display dialog "Set the Start Times of selected audio cues to start of audio" & return & "This plays each cue until the start of the audio" & return & " The first 1/10 second of each cue will be audible!"
try
tell application id "com.figure53.QLab.5" to tell front workspace
set theselected to (selected as list)
repeat with eachCue in theselected
set the selected to eachCue
set the start time of eachCue to 0
set the post wait of cue "RMS" to 0
delay 0.1
start eachCue
start cue "DETECT"
repeat until post wait of cue "RMS" > threshold
delay 0.01
end repeat
pause eachCue
set the start time of eachCue to the (action elapsed of eachCue) - 0.1
stop eachCue
stop cue "DETECT"
end repeat
end tell
on error
display dialog "Something Went Wrong!" & return & "Are selected cues all audio?"
end try