List Mail's mailbox hierarchy w AppleScript?
List Mail's mailbox hierarchy w AppleScript?
- Subject: List Mail's mailbox hierarchy w AppleScript?
- From: John Carlsen <email@hidden>
- Date: Fri, 13 Sep 2002 10:27:30 -0400
[ I originally posted this in the Macscript list: Daniel A. Shockley gave me
a nice hack to work around the problem; it only works in English. Now I want
to know if there is a way to do it _properly_ in Mail 1.2.]
I am adding support for Mail 1.2 (OS X 10.2) in my eMessage Archiver scripts
and database, which support most popular email applications.
In other email applications, I can easily get a hierarchical list of
mailboxes (or folders) in the user's email application. I then save this as
text entries in a FileMaker repeated field, and let the user check which
folders he wants to archive. The text list usually looks something like
this:
"John"
"John/Lists"
"John/Other/music" -- this is what I want.
Later I retrieve the list of checked items as an AppleScript list, and can
reconstruct the mailbox reference for each one by parsing the list and
writing something like:
mailbox "music" of mailbox "Other" of mailbox "John"
to refer to each mailbox. (This form works for PowerMail, Entourage,
Emailer, Eudora, etc.).
But when I get a list of mailboxes from Mail, I get instead a list of
AppleScript references with this clear but non-standard form:
mailbox "John" of application "Mail"
mailbox "John/Lists" of application "Mail"
mailbox "John/Other/music" of application "Mail"
I cannot make that obvious hierarchy into any form of text item because the
references cannot be coerced to a text object, and if I ask for the mailbox
reference's "name", I get just
"John"
"Lists"
"music" -- this is what I get, but cannot use
with no way of getting the enclosing mailboxes so I can later refer to each
mailbox to Mail with a proper reference.
Any ideas?
--
Cheers,
John
eMessage Archiver:
http://homepage.mac.com/ThinkAgain/Mac/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.