On Dec 31, 2010, at 5:26 PM, LuKreme wrote: On 31-Dec-2010, at 14:34, Luther Fuller wrote:
tell application "Mail"
-- end tell
that returns: get every mailbox --> {mailbox "Junk (Kreme)", mailbox "Sent Messages (List)", mailbox "ToDos", mailbox "Notes", mailbox "Outbox", mailbox "Junk (Work)"} There are many many many more mailboxes than that. $ ls -1 ~/Library/Mail/IMAP-kreme\@kreme.com/INBOX/ | wc -l 56 And it only returns those few mailboxes spread over at least three account (Kreme, List, Work), ignoring the other 6.
Mmmmmmmm! A little more experimenting. (10.6.5) I find that ...
set mailboxList to mailboxes as list
returns only mailboxes without an account, that is, mailboxes "OnMyMac" plus the mailboxes "ToDos", "Outbox", "Drafts (MobileMe)", "Sent Messages (MobileMe)", "Deleted Messages", "Deleted Messages (MobileMe)", "Junk", "Junk (MobileMe)"
If you want to see other mailboxes you have to use
set mailboxList to mailboxes of account accountName as list
to get a list of mailboxes for that account. Modifying my original script might give you info on how to access any mailbox.
|