1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Progress display

Discussion in 'iTunes & AppleScripts' started by UKenGB, Jan 25, 2016.

  1. UKenGB

    UKenGB Member

    Trying to use AppleScript's progress display indicator in a script running from the iTunes Script menu, but I don't seem to be getting anywhere.

    I want the script as a script, not an app and the docs say the progress should be shown in the 'ScriptMonitor menu' and I have no idea what that is. What I can say is that when running my script from iTunes menu, there is NO progress display whatsoever. Anyone suggest how to get a meaningful progress display? A nice progress bar in a dialog would be nice, as you get when the script is saved as an app.

    So why not save as an app? For some reason, it won't run correctly and throws errors, yet it runs PERFECTLY as a script. I'm trying to find out why e.g. it falls over when trying to set a variable to 'fixed indexing'. No problem as a script, as an app just throws an error. This just should NOT happen with software from a company like Apple. Anyway...

    So if anyone can suggest how to simply get a progress display from a script and/or why something that runs as a script falls over as an app, it would be much appreciated.
  2. UKenGB

    UKenGB Member

    It would appear the problem with the app version falling over was due to a quirk (to put it nicely) of AppleScript.

    As that script was purely for iTunes, I used a new(ish) feature of AppleScript to specify the script be targeted at iTunes, by the use of the pop up menu at the top, which means you don't need to explicitly provide a 'Tell' statement. This works perfectly as a script, but when saved as an application, this all encompassing 'Tell...' seems to be dropped, so any terms specific to the app that was specified are lost and hence it falls over. I changed my script to eliminate that overall target and added an explicit Tell iTunes block, which of course still runs fine as a script, but now also runs when saved as an application. :)

    Maybe I missed the documentation that mentioned this 'feature'. Otherwise, I'd say it's a bug and Apple's AppleScript developers simply forgot to include this new feature when saving a script as an app. Whatever.

    So if you have a problem when your perfectly running script is saved as an app, this might be it.

    Since I can now save as an app, I get the nice progress dialogs as I want and also I can bundle any required additions with it, so this entirely solves my problem.
  3. UKenGB

    UKenGB Member

    And now another problem with AppleScript's progress display.

    I've set up a script that runs a long rsync task. I use AppleScript's progress display to indicate how things are progressing and when run as a script in Script Editor, I get the expected display in the bottom of SE window. But I want to call it from iTunes' Script menu, so I save it as an app in the appropriate location and try running it from there.

    It starts by asking me if I want to continue, correctly using the dialog box I set up in the script, but when I click on the button to continue, the dialog box goes away and it then displays a big fat nothing. I get a Menu bar apparently from this app, but NO Progress dialog that I should get when running an app not from the main Script menu.

    Since I apparently had this working when I started this thread, I can only assume something has changed in the AppleScript ecosystem. Can anyone shed any light on why AppleScript's progress displays nothing when run from iTunes' Scripts menu?

Share This Page