I want my macOS app to display a modal progress bar like this:
and want to update the progress by AppleScript.
osascript -l JavaScript -e '
const app = Application("MyApp")
app.includeStandardAdditions = true
app.activate()
Progress.totalUnitCount = 100
Progress.completedUnitCount = 1
Progress.description = "Processing..."
Progress.additionalDescription = "Preparing to process."
for (i = 0; i < 100; i++) {
Progress.additionalDescription = "Processing " + i + " of " + 100
Progress.completedUnitCount = i
delay(1)
}
'
How to do that? What should I do in my MyApp
?