Mailboxes in Mail & Applescript
Mailboxes in Mail & Applescript
- Subject: Mailboxes in Mail & Applescript
- From: John Mitchell <email@hidden>
- Date: Thu, 26 Apr 2012 22:35:18 +1000
Dear all
I have moved from Eudora to Mail…
I have a large set of folders (Mail mailboxes) termed in Mail "On my Mac"
I use them as primary "folders" to collect like sets of emails…
How can I select that list (115 Mailboxes) "
I use this code:
tell application "Mail" set mailDefaultList to {"In", "Out", "Sent", "Drafts", "Trash", "Junk"} try set folderList to {} -- can I restrict this to top level only? set folderCount to count of mailboxes --of mailbox "ON MY MAC" repeat with thisFolder from 1 to folderCount if mailDefaultList does not contain (name of mailbox thisFolder) then set end of folderList to (name of mailbox thisFolder) end if end repeat on error errMsg number errNum -- some error return {false, ""} end try end tell
debugging this, mailbox 1 is null, and mail box 114 is the name of the enclosing Mailbox that comprises the preceding list - the one I'm looking for.
In summary, this gives me every mailbox in the database (1300+). But I want only the top level mailbox names (113).
Can i use the term container to get the list?
Does anyone have a suggestion?
regards
John
CQR Pty Ltd 1005/2 Dind Street, Milsons Point, NSW 2061 Australia ABN: 45 001 785 191 • NSW ARBN: 3605 Email: email@hidden • Mob: +61 410 318 131 Skype: jrmitchell Tel: +61 (2) 9922 3785 • Fax: +61 (2) 9929 4035
|
_______________________________________________
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