I’ve got a script that uses Applescript’s built-in progress bar.
If I save the script as an app, run it, progress-bar UI works fine.
But this script is a bit different… it needs to run called from another script, which is on a command key in FastScripts.
The reason it’s run by another script is that the main script accepts an argument that tells it what command key it was run from… it’s a long script that does slightly different things based on which key invoked it.
So it’s called from a script that’s just:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell script "Script Additions" to set scriptsPath to POSIX path of get_scripts_folder()
set openOrderScript to (POSIX file (scriptsPath & "Bigger Script.app")) as alias
run script openOrderScript with parameters {1}
The function “get_scripts_folder()” just returns the path the scripts are in.
Then the longer script runs.
When I first tried this, I just changed the longer script that gets called - “Bigger Script.app” here - to a .app, where it has been a .scpt. That didn’t make it display the dialog, so I thought “shoot, it won’t work because it’s still being called by a .scpt.”
So I made the calling script a .app. No luck, still no UI.
If I disable the “on run” handler in the big script and set the incoming argument directly, and run that off FastScripts, the progress dialog UI shows fine. So it’s not just a run-of-the-mill script bug in the big script, it’s either something about the “on run” handler, or, more likely I figure, the fact it’s being called from another script, even though both are .apps.
Any help please?
Thanks in advance,
t.spoon