Toying with progress more, and I notice that in this script, if I have debugging on, when I run it SD hangs with the swirly rainbow cursor for a few seconds and then the progress pane starts up at 6 or 7. If I turn off debugging it behaves normally, if I turn debugging back on it works normally too, but if I recompile the hang returns.
my updateProgress({ProgressTotalSteps:10, ProgressCompletedSteps:0, ProgressDesc:"Testing progress", ProgressExtraDesc:"Starting Up"})
delay 2
repeat with progressCounter from 1 to 10
delay 1
my updateProgress({ProgressCompletedSteps:progressCounter, ProgressExtraDesc:"Step " & progressCounter as text})
end repeat
on updateProgress(progressRecord)
local progressRecord, totalSteps, completedSteps, desc, extraDesc
--{ProgressTotalSteps: 10,ProgresscompletedSteps:1, ProgressDesc:"", ProgressExtraDesc:"" )
try
set totalSteps to ProgressTotalSteps of progressRecord
on error
set totalSteps to ""
end try
try
set completedSteps to ProgressCompletedSteps of progressRecord
on error
set completedSteps to ""
end try
try
set desc to ProgressDesc of progressRecord
on error
set desc to 0
end try
try
set extraDesc to ProgressExtraDesc of progressRecord
on error
set extraDesc to 0
end try
if totalSteps is not "" then set progress total steps to totalSteps
if completedSteps is not "" then set progress completed steps to completedSteps
if desc is not 0 then set progress description to desc
if extraDesc is not 0 then set progress additional description to extraDesc
end updateProgress