Standard Additions Commands No Longer Work

Anyone have any idea why a script containing Standard Additions commands might just stop running on my machine? The script chokes when it hits a Standard Addition command. The StandardAdditions.osax is installed in the /library/ScriptingAdditions folder, no problem there.

Example Error:
Finder got an error: “Enter a Name for this artpack:” doesn’t understand the display dialog message.

Code:
tell application “Finder”
activate
display dialog “Enter a for this artpack:” default answer “”
set artPack to text returned of result
end tell

Last week this worked just fine.

Using Mac OS X 10.6.7
iMac 2 GHz Intel Core 2 Duo
4GB memory

Any suggestions would be appreciated. If I can’t solve this, I guess I won’t be writing any more scripts for my Designers.

Since the delivery of 10.6, calling a function of an OSAX in a tell block may generate an error.
Sometimes it’s automatically filtered, sometimes it’s not.

In your case, the tell Finder is useless.


display dialog "Enter a for this artpack:" default answer ""
set artPack to text returned of result

would be sufficient

but I’m puzzled because here, your original code behave flawlessly.

Yvan KOENIG (VALLAURIS, France) jeudi 26 mai 2011 19:01:58

It should be in /System/Library/ScriptingAdditions/.

And it should work. While Yvan’s advice not to put OSAX commands inside application ‘tell’ blocks is generally sound (to avoid possible terminology clashes), the various kinds of dialog the StandardAdditions provide are meant to appear in one application or another: either the application running the script or another which it tells to display them.

I must admit I’ve no idea what’s happening in your case. I’d check permissions, the presence of one (and one only) StandardAdditions OSAX, what happens with other StandardAdditions commands, what happens with other OSAX commands, any problems with AppleScript Editor, typos in your source code, etc.

Good luck.