• 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: What Does Error Return ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What Does Error Return ?


  • Subject: Re: What Does Error Return ?
  • From: Stan Cleveland <email@hidden>
  • Date: Fri, 13 Mar 2015 14:12:03 -0700

On Mar 13, 2015, at 7:12 AM, Luther Fuller <email@hidden> wrote:

I looked in the AppleScript dictionary for information on errors and found this ...

error v : Raise an error

error [anything]
[number small integer] : an error number
[partial result list] : any partial result occurring before the error
[from anything] : the object that caused the error
[to anything] : the desired class for a failed coercion

The AppleScript Language Guide, Appendix C gives some examples, but does not give
an example explaining the the meaning and usage of the 'from' and 'to' parameters.

Does anyone know what these are and where I can see an example of their usage ?

Hi Luther, 

The AS dictionary entry you found documents the command to throw an error, not a thrown error. When an error occurs, it may return all those parameters plus one—the application that got the error. Bear in mind that only parameters relevant to the error are returned.

Standard error dialogs (from a script application or AppleScript Editor) display only the error message and number. However, you can see other included parameters in AS Editor's event log and its result window. 

To see all the available error parameters in a dialog box, you need Script Debugger. Click the link below to see SD's enhanced dialog, with 'error' terminology annotated in red.

FYI,
Stan C.

http://codemunki.com/Examples/onErrorDialog.png

 _______________________________________________
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

References: 
 >What Does Error Return ? (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Can't Coerce String to Date?
  • Next by Date: Re: Can't Coerce String to Date?
  • Previous by thread: Re: What Does Error Return ?
  • Next by thread: Re: What Does Error Return ?
  • Index(es):
    • Date
    • Thread