Re: Problems with lists in Mail
Re: Problems with lists in Mail
- Subject: Re: Problems with lists in Mail
- From: Christopher Stone <email@hidden>
- Date: Mon, 08 Aug 2011 17:22:35 -0500
On Aug 08, 2011, at 16:48, Luther Fuller wrote: This problem occurs in both Snow Leopard and Lion.
tell application "Mail" set frontViewer to (some message viewer whose index is 1) set msgList to selected messages of frontViewer
--> On Snow Leopard I thought this returned an empty list, but I can't test just now. --> On Lion this returns a 'missing value'.
class of msgList
--> With 'missing value' it returns 'class' on my system.
end tell
With lists I usually use 'length' rather than 'count'. Length is a property of the list and used to be faster than count.
tell application "Mail" set frontViewer to (some message viewer whose index is 1) set msgList to (selected messages of frontViewer) as list
--> {missing value}
length of msgList
--> 1
class of msgList
--> list end tell
tell application "Mail" selection end tell
Will return the selected messages in the front message viewer, and it still returns an empty list if there is no selection.
HTH.
-- Best Regards, Chris
|
_______________________________________________
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