Another AppleScript Tidbit

When intentionally generating an error in AppleScript you can supply the error message and number (and probably the other parameters, if you care about them). If this error is not trapped by a try handler, it is passed back to the caller.

What I discovered today is this: if you generate an error and give it error number 0, Script Debugger does not report the error in its standard error sheet. (AppleScript Editor does report the error.)

I’m not sure if this is an intentional bit of niceness — it gives you a way of stopping the script without being bothered by a dialog — or a mistake based on the fact that, in Cocoa, et. al. “error 0” means noErr.

google_pluslinkedingoogle_pluslinkedinby feather

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.