• 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
Puzzling Error Explained
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Puzzling Error Explained


  • Subject: Puzzling Error Explained
  • From: Luther Fuller <email@hidden>
  • Date: Sat, 5 May 2007 18:00:36 -0500

After more work with my pesky little error, I discovered that adding "as text" to the following line ...

	tell application "Mail"
		set subText to (subject of msg) as text

solved my problem. (Using the 'try' block is not necessary.)

Here's my conjecture about what's happening. 'subject of msg' returns unicode text. I have nothing against unicode, but text commands such as string comparison apparently do have a problem with it and do not report the error properly. The line ...

	newWord is not in badWords

chokes when it tries to compare the unicode text in newWord with the strings in the list badWords. The real error in this case is: Error = -1700 "Can't make "?A?i?^???..." into type string." But when this error is passed back up thru 5 layers of handler calls, all I see is the message "The cancel button cannot be the same as the default button." The error never reaches my master error catcher, because the error reporting mechanism also chokes on the unicode text. (I found the -1700 error by trapping the error at its source.)

I had suspected months ago that the "The cancel button ..." error message was caused by a problem with unicode, but finding such a small error in a script that is over 30 pages of 9 point monaco is not easy. Reproducing the error is almost impossible since simply trying again is usually successful.

Can anyone confirm or deny this conjecture? And does anyone know more?

_______________________________________________
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: 
 >Puzzling Error Again (From: Luther Fuller <email@hidden>)
 >Re: Puzzling Error Again (From: "Mark J. Reed" <email@hidden>)
 >Re: Puzzling Error Again (From: Luther Fuller <email@hidden>)

  • Prev by Date: Is there an example how to remove duplicate pieces of a record in Address Book?
  • Next by Date: Re: Is there an example how to remove duplicate pieces of a record in Address Book?
  • Previous by thread: Re: Puzzling Error Again
  • Next by thread: Determine whether spot color is RGB or CMYK in Illustrator CS2
  • Index(es):
    • Date
    • Thread