
---Setup script with progress bar
--requires MicsProgressBar.app to be installed in applications folder
--requires a memo cue numbered "PROGV"
--tested with QLab5
--use at your own risk
tell application id "com.figure53.QLab.5" to tell front workspace
set theCount to 25 --number of iterations (can be calculated)
set the pre wait of cue "PROGV" to 0
set the post wait of cue "PROGV" to theCount
tell application "MicsProgressBar" to activate
repeat theCount times
-------------------------------
--do some stuff
delay 0.1
----------------------------------
--increment the count
set the pre wait of cue "PROGV" to the (pre wait of cue "PROGV") + 1
end repeat
end tell
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
try
repeat
tell application "QLab5" to tell front workspace
set theSteps to the post wait of cue "PROGV"
set theCompleted to pre wait of cue "PROGV"
set theDescription to q list name of cue "PROGV"
end tell
if theCompleted ≥ theSteps then quit
set progress total steps to theSteps
set progress completed steps to theCompleted
set progress description to theDescription
delay 0.1
end repeat
--quit routine for Script Debugger Enhanced apps
on error number -128
quit
end try
Screen recording attached