• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Suppressing the error dialog box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Suppressing the error dialog box
      • From: "Stockly, Ed" <email@hidden>
    • Re: Suppressing the error dialog box
      • From: Yvan KOENIG <email@hidden>
References: 
 >Suppressing the error dialog box (From: Tom Horton <email@hidden>)

  • Prev by Date: Re: Suppressing the error dialog box
  • Next by Date: Re: Tell application variable for remote service
  • Previous by thread: Re: Suppressing the error dialog box
  • Next by thread: Re: Suppressing the error dialog box
  • Index(es):
    • Date
    • Thread