Puzzling Error Explained
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