r/applescript • • Mar 04 '23

Help! Progressbar doesn't show while called from shell.

I'm fiddling with applescript that makes a progressbar.

set progress description to "A simple progress indicator"
set progress additional description to "Preparing…"
set progress total steps to -1

delay 0.1

set progress total steps to 30
repeat with i from 1 to 30
	try
		set progress additional description to "I am on step " & i
		set progress completed steps to i
		delay 0.1
	on error thisErr
		display alert thisErr
		exit repeat
	end try
end repeat
-- Taken and edited from https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/DisplayProgress.html

While run in the script editor, I can see the progress icon running. However, when I call the script with shell osascript ~/the_script.scpt, it only hangs for 3 seconds and exits without showing any progressbar. Additionally, I do need to run it from shell, because at the end I hope other types off applications (e.g. emacs) can call a progressbar too.

How do I fix this issue?

1 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/stuudente Mar 04 '23

Yeah.. showing notification a lot isn't really what I'm looking for. Thank you for your help though :)