Digging around encountered problem, I made some further tests. It is indeed possible to have more than 2 progress bars in window, but there’s definitely something weird around progress bar 2 when we try to have 3 or more of them.
This leads to a -1000 error
tell application "SKProgressBar"
set ProgressBar2 to make new progress bar at after progress bar 1 with properties {header:"2nd"} --> OK
set ProgressBar3 to make new progress bar at after progress bar 2 with properties {header:"3rd"} --> error -1000
end tell
While this executes without error
tell application "SKProgressBar"
set ProgressBar2 to make new progress bar at after progress bar 1 with properties {header:"2nd"} -- OK
set ProgressBar3 to make new progress bar at before progress bar 2 with properties {header:"3rd"} -- OK
-- set ProgressBar4 to make new progress bar at after progress bar 3 with properties {header:"4th"} --> error -1000
set ProgressBar4 to make new progress bar at after progress bar 2 with properties {header:"4th"} -- OK
set AllProgressBars to every progress bar
set show window to true
end tell
3 progress bars are created besides main, but both ProgressBar2 and ProgressBar3 have ‘progress bar 2’ object as value and window seems to display the 3 extra-bars as the same, all with ‘2nd header’. However
every progress bar
do return 4 different objects: main as progress bar 1, named ‘3rd’ as progress bar 2, named ‘4th’ as progress bar 3 and named ‘2nd’ as progress bar 4 (quite logical considering location set in make commands).
All that said, considering my need of 6 progress bars for 6 parallels processes, I’ve ended up with the following:
tell application "SKProgressBar"
repeat with i from 1 to 7
make new progress bar at after progress bar 1 with properties {header:"#"}
end repeat
set progress bar 1's header to "Bar 1"
set progress bar 2's header to "Bar 2" -- not displayed
set progress bar 3's header to "Bar 3"
set progress bar 4's header to "Bar 4"
set progress bar 5's header to "Bar 5"
set progress bar 6's header to "Bar 6"
set progress bar 7's header to "Bar 7"
set progress bar 8's header to "Bar 8" -- displayed twice
set show window to true
quit
end tell
I thought I would just have to do ‘delete progress bar 2’ and ‘delete bar 8’ to fall back on my feet, but it’s still not working properly: display is fine but tests proved we still need to address progress bars with their original index, so at the end the last bar is unusable.
I’d be grateful for any help or fix.