Problems with lists in Mail
Problems with lists in Mail
- Subject: Problems with lists in Mail
- From: Luther Fuller <email@hidden>
- Date: Mon, 08 Aug 2011 16:48:05 -0500
This problem occurs in both Snow Leopard and Lion.Here's the script ...
tell application "Mail" set frontViewer to (some message viewer whose index is 1) set msgList to selected messages of frontViewer count selected messages of frontViewer --> this returns 0 if selection is empty without error count items of msgList -- this errors if the selection is empty class of msgList --> pcls, if empty list; list, if list is not empty end tell
Shouldn't msgList be a 'list' even if it's an empty? What is 'pcls'?
I've tried changing the second line to ...
set msgList to (selected messages of frontViewer) as list
But, there is still a problem if there is no selection:
incorrectly returns 1, but
now correctly returns 'list'.
The work-around for this problem is simply to use count selected messages of frontViewer . But why shouldn't I get a list, always, which has count = 0, if appropriate?
|
_______________________________________________
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