• 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: catching multiple errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: catching multiple errors


  • Subject: Re: catching multiple errors
  • From: kai <email@hidden>
  • Date: Fri, 23 Jun 2006 22:43:33 +0100


On 23 Jun 2006, at 19:15, Michelle Steiner wrote:

On Jun 23, 2006, at 10:55 AM, Jeremy Matthews wrote:

Does anyone have an example of applescript syntax for catching multiple errors?

For example, catch errors if people chose to cancel, or if a file wasn't there, or the preference was changed, etc...

Nested if-then statements within a try block.

That rings a bell, in a déjà vu-ish kinda way... ;-)

http://lists.apple.com/archives/applescript-users/2006/Jun/msg00244.html

To perform the same action for various errors, we could also (borrowing from Michelle's example) use something like:

-------

try
	display dialog "enter the file name" default answer "text.txt"
on error msg number num
	if num is in {-1, 25, -128} then
		-- respond in the same way for any of the above
	else
		-- do something else
	end if
end try

-------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >catching multiple errors (From: Jeremy Matthews <email@hidden>)
 >Re: catching multiple errors (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: catching multiple errors
  • Next by Date: Re: Currency Numbers
  • Previous by thread: Re: catching multiple errors
  • Next by thread: [OT] Re: Is it possible to make an AppleScript application a URL handler?
  • Index(es):
    • Date
    • Thread