Skip to content

Instantly share code, notes, and snippets.

@jorng
Last active July 7, 2019 13:17
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jorng/23eb613d729450e76822 to your computer and use it in GitHub Desktop.
Save jorng/23eb613d729450e76822 to your computer and use it in GitHub Desktop.
Simple AppleScript progress bar demo for Yosemite
set progress description to "A simple progress indicator"
set progress additional description to "Preparing…"
set progress total steps to -1
delay 5
set progress total steps to 100
repeat with i from 1 to 100
try
set progress additional description to "I am on step " & i
set progress completed steps to i
delay 0.2
on error thisErr
display alert thisErr
exit repeat
end try
end repeat
@dgpokl
Copy link

dgpokl commented Feb 15, 2017

@RobLewis, it looks from my experimentation that the -1 is what makes it show the progress indicator as intdeterminate. When running in the Script Editor, this makes it a spinny thingy (instead of a pie), and when it's an Application, it shows the progress bar filled solid when total steps is at -1 (instead of showing one at 0%). I think it's what you would do when you're doing some kind of startup work (especially when you don't know how long it'll take) before you enter your main processing loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment