ctwise Posted October 17, 2014 Share Posted October 17, 2014 Just noticed this after installing Yosemite: Progress Reporting AppleScript now has built-in support for reporting progress in a script. The global AppleScript object has four new properties: progress total steps (an integer) progress completed steps (an integer) progress description (text) progress additional description (text) A script may set any of these properties at any time during the script to update the progress display. progress completed steps divided by progress total steps provides the fraction completed; if completed or total is -1, progress is considered indeterminate. progress description and progress additional description provide a message about what the script is doing. Exactly how the progress is displayed depends on how the script is run: in Script Editor, it appears in the script window’s status bar; in script applications (applets), it appears as a progress dialog; and for scripts run from Script Menu, it appears in the Script Monitor menu. (Script Monitor appeared in previous system releases, but was only used for Automator workflows; it now displays any script run using NSUserScriptTask, which includes anything run from Script Menu.) Carlos-Sz and dfay 2 Link to comment
dfay Posted October 18, 2014 Share Posted October 18, 2014 As far as I can tell, the only way to get this to display is by including an app bundle in a workflow, right? I tried an Applescript object and a Script -> osascript object and neither produced a progress window or anything in the Alfred workflow log. Link to comment
ctwise Posted October 19, 2014 Author Share Posted October 19, 2014 As far as I can tell, the only way to get this to display is by including an app bundle in a workflow, right? I tried an Applescript object and a Script -> osascript object and neither produced a progress window or anything in the Alfred workflow log. I think you're right. I let my enthusiasm take me away. :-) I'm not sure if it's possible for Alfred to serve as the progress display "handler". I notice that the script editor displays the progress with a pie chart and logging messages in the bottom of the script window, so at some level it should be possible. Link to comment
iandol Posted September 14, 2017 Share Posted September 14, 2017 Does anyone have any updated info on whether there is a way to get this built-in applescript progress indicator to work for scripts in workflows? Is the only other alternative cocoaDialog? Thanks for any pointers... Link to comment
deanishe Posted September 14, 2017 Share Posted September 14, 2017 You can create a progress bar in Alfred itself, using a Script Filter, rerun and variables. Link to comment
iandol Posted September 14, 2017 Share Posted September 14, 2017 Thanks deanishe, very neat idea, however my applescript can run for 3-5 minutes in the background so blocking Alfred for this time wouldn't be much use. I found this tool: https://github.com/tsntsumi/ProgressDialog However it uses "tell application" and I can't see how that would work if it is stored in the workflow bundle. So annoying Apple never made Applescript progress work for scripts... Link to comment
deanishe Posted September 14, 2017 Share Posted September 14, 2017 3 hours ago, iandol said: blocking Alfred for this time wouldn't be much use. It doesn't block Alfred. Your long-running script should write its progress to a file, and a separate Script Filter then reads the file and shows the progress bar. You can open and close it as you please. iandol 1 Link to comment
iandol Posted September 14, 2017 Share Posted September 14, 2017 1 hour ago, deanishe said: It doesn't block Alfred. Your long-running script should write its progress to a file, and a separate Script Filter then reads the file and shows the progress bar. You can open and close it as you please. Woah, that is super cool. Will give it a go thanks!!! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now