Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Work around an AppleScript bug in iTunes 9.0.2' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Work around an AppleScript bug in iTunes 9.0.2
Authored by: SuperCrisp on Dec 10, '09 08:52:04AM

I found that saving an application script bundle as a script (.scpt) allows it to run just fine in the regular place with no other changes. I don't know if this would work in all instances, but it worked for the one script I needed.



[ Reply to This | # ]
Work around an AppleScript bug in iTunes 9.0.2
Authored by: DougAdams on Dec 10, '09 05:48:21PM
I found that saving an application script bundle as a script (.scpt) allows it to run just fine in the regular place with no other changes. I don't know if this would work in all instances, but it worked for the one script I needed.

Don't do that. There is a reason a script is saved as either an app or plain compiled script. While you were lucky that the change you made to the script seemingly had no effect, this is a hack which will not be beneficial in most instances.
---
Doug's AppleScripts for iTunes
dougscripts.com
Edited on Dec 10, '09 05:50:09PM by DougAdams


[ Reply to This | # ]
Work around an AppleScript bug in iTunes 9.0.2
Authored by: tedw on Dec 10, '09 07:01:17PM
I think you misunderstood. If you take an script application and save it as a plain script, there's no harm in that. it may not work as expected (some scripts have features that require them to be applications), but the script should run just fine. Saving them as non-bundle script applications might be more of a problem, but you'd need a 10.5 Script Editor to do it (I don't think the 10.6 version has an option for it). Few iTunes scripts need to be applications (you only need to make a script an application if the script is intended to remain open, needs to be called by other processes, or the like).

most script bundles can be converted to plain scripts without issue. For those that can't, all you need to do it write a plain script with the line Tell application "Finder" to open file "path:to:scriptapplication.app", and put that script in iTunes script menu. poor man's alias file...

[ Reply to This | # ]

Work around an AppleScript bug in iTunes 9.0.2
Authored by: DougAdams on Dec 11, '09 09:20:51AM
If you take an script application and save it as a plain script, there's no harm in that.

Of course, if a script author doesn't know the reasons to save as app or scpt, then I suppose you are right. But I wouldn't want to depend on bad script writing just to make this workaround work.
---
Doug's AppleScripts for iTunes
dougscripts.com


[ Reply to This | # ]
Work around an AppleScript bug in iTunes 9.0.2
Authored by: Hal Itosis on Dec 11, '09 08:25:58AM
Don't do that. There is a reason a script is saved as either an app or plain compiled script. While you were lucky that the change you made to the script seemingly had no effect, this is a hack which will not be beneficial in most instances.

Actually, i've found the opposite to be true. In *most* instances, folks save scripts as applets for absolutely no good reason (other than it enables them to be double-clicked or Docked i suppose). Whereas, saving as a .scpt instead and "launching" from Script Menu (or hotkey via FastScripts, or Spark, etc.) results in the same code running some six times faster [which certainly qualifies as a benefit, IMO].

I suppose there may be a few exceptions, but i have yet to encounter one.

-HI-



[ Reply to This | # ]
Work around an AppleScript bug in iTunes 9.0.2
Authored by: tedw on Dec 11, '09 12:05:04PM
The only reasons I can think of (off hand) to save a script as an application are
  1. you need the script to stay open for a while to watch or wait for some event
  2. you need the script to preserve data across runs (properties won't be retained in a .scpt file, but they will in an app package)
  3. other apps need to call the running script (.scpt files don't have an easily accessible system identity, while app packages do)
  4. you need or want to run the script from the Finder rather than a scripting context like the script menu
if none of those apply, your script should run fine as a script file.

[ Reply to This | # ]