Weird Problem

Applescript is broken for my user account on both my iMac G5 and G4 Powerbook. Both are running 10.4.2, and both exhibit the same symptoms. When I run this script from within Script Editor, it works fine:

display dialog "Hello"

If I save it as an application and run it, I get a dialog box which says

“Hello” doesn’t understand the <> message.

If I run the application from a user account for which no third party software has been installed, it works fine. I have fixed permissions and run Disk Warrior to no avail.

Does anyone have any idea what might be causing this? Any suggestions will be gratefully appreciated.

Looks like the script could be picking up the Cocoa terminology for ‘display dialog’ - such as that used in Xcode/Studio apps, Automator, etc. Without more context, it’s hard to say quite why this should be happening. (I take it you’ve tested this as indicated, with no ‘tell’ or ‘using terms from’ blocks - and with only core processes and Script Editor running?)

As a temporary measure, there might be one or two workarounds. For example, when finally saving your script as an application, you could try replacing:

with

Make sure this replacement is carried out last thing (with no recompiling) before saving. (You may notice that the raw code compiles to ‘display dialog’ - but at least it should then be saved correctly to the application file.) Note that, if you subsequently need to modify and re-save the script for any reason, you’ll probably have to repeat the replacement, too.

To avoid all this messing about when recompiling, another possibility is to try and force the saving of the Standard Additions term with a ‘using terms from’ block:

using terms from application "Script Editor" (* or "Finder", "System Events", etc. *)
	display dialog "Hello"
end using terms from

However, even if these suggestions do help to suppress the symptoms, they’re obviously no substitute for a proper cure. For that, you may have to isolate each of your third-party applications and scripting additions, in a bid to (hopefully) determine which is the culprit…

Good luck. :slight_smile: