• 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: AS ERROR...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AS ERROR...


  • Subject: Re: AS ERROR...
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 12 Apr 2007 16:29:58 -0700
  • Thread-topic: AS ERROR...

Don,

Here's what I would try:

 tell application "Printer Setup Utility"
 try
 set the current printer to printer "Officejet 6200 series"
 Set errmsg to "No Error"
 on error errMsg number errNum
  Log errMsg
 end try
 quit
 end tell
 set field "gERROR" of table "Computers" to errMsg


In your script the variable errmsg is only defined if an error occurs.



In the version above, if there is no error, then
> tell application "Printer Setup Utility"
> try
> set the current printer to printer "Officejet 6200 series"
> on error errMsg number errNum
> end try
> quit
> end tell
>
> set field "gERROR" of table "Computers" to errMsg
>
> When I MISPELL the printer name, the script run to completion and spits the
> error in my FMP fields called "gERROR".
>
> When I spell the printer name CORRECTLY, the script generates AS errors
> saying the errMsg was not declared (also an error number).  What do I need
> to change to get it to run to completion in both scenarios?
 _______________________________________________
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

  • Prev by Date: AS ERROR...
  • Next by Date: Re: AS ERROR...
  • Previous by thread: Re: Symbol typing
  • Next by thread: Creating new file etc
  • Index(es):
    • Date
    • Thread