Re: Suppressing the error dialog box
Re: Suppressing the error dialog box
- Subject: Re: Suppressing the error dialog box
- From: Axel Luttgens <email@hidden>
- Date: Fri, 21 May 2010 09:57:31 +0200
Le 21 mai 2010 à 09:04:23, Tom Horton a écrit :
> I'm need to detect an error in my AppleScript using on error, but I don't want to see the dialog box prompting me with OK or Cancel. I just need to know there was an error.
> Is there an option to suppress the error dialog?
Hello Tom,
Error handling is described in the language guide:
http://developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/AppleScriptLanguageGuide.pdf
and is mainly achieved with the "try" statement (see page 211).
For example:
set x to 0
try
set y to 1 / x
on error errMsg number errNum
-- if an error occurs, errNum contains the numerical
-- error code, while errMsg contains an error message
-- (the one that would have been diplayed in a dialog
-- box without the try statement)
end try
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden