• 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: cure for NSArgumentEvaluationScriptError?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cure for NSArgumentEvaluationScriptError?


  • Subject: Re: cure for NSArgumentEvaluationScriptError?
  • From: jj <email@hidden>
  • Date: Wed, 22 Sep 2004 10:48:26 +0200

> Help understanding the use of "errMSG" would be appreciated.

An error in AppleScript has four parameters, apart from the error message
itself. Take a look to this example, which still works and demonstrates the
existence of these:

##############################################
try
    handle CGI request "káspita"
on error msg number n from obj to newClass partial result y
    {msg:msg, n:n, obj:obj, newClass:newClass, y:y}
end try

-->
(*
{
msg:"The searching for parameter is missing for handle CGI request.",
n:-1701,
obj:«class kfor»,
newClass:handle CGI request,
y:«handler handle CGI request»
}
*)

on handle CGI request x searching for y
    return ""
end handle CGI request
##############################################

In a try/on-error/end-try statement, the values of "msg" (or "errMSG" in
your example) and those parameters which optionally you include ("n",
"obj"...), are filled automatically when the error happens.

And you can create such errors yourself:

##############################################
error "This is a sample error" number 4271
##############################################
##############################################
try
    error "This is a sample error" number 4271
on error msg number n
    display dialog "Error number " & n & ":" & return & msg with icon 0
end
##############################################

(Apple says you may choose numbers 500 to 10000 in your errors, which won't
conflict with the system)


jj

--
http://www.macscripter.net/
http://www.osaxen.com/


 _______________________________________________
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

  • Prev by Date: Re: Re : Vooley-voo... (was Bug ?)
  • Next by Date: Re : Vooley-voo... (was Bug ?)
  • Previous by thread: Re: cure for NSArgumentEvaluationScriptError?
  • Next by thread: Re: Subject: Crontab doesn't work for me
  • Index(es):
    • Date
    • Thread