Apologies for coming into this discussion late - just found it in the archives on lists.apple.com, and also can't find a way to reply directly to the thread on the web.
So I've been looking at a similar scenario, but have a slightly different arrangement of mailboxen:
On the company exchange server:
- work account inbox + svn + chronicle + opsnotify
On my Mac:
- work archive + 2008 +200810 +200811 +200812 +2009 +200901 +200902 etc ... +2010 + 201001
What I'm trying to do is to write a script that goes through the work account subfolders, such as "svn", "chronicle" etc, marks the messages as read, and then moves them to the "work archive" mailbox subfolder on my mac that corresponds with the month the message was received.
I am really new to Applescript and struggling to wrap my head around it whilst holding down a busy job and still finding time for the family etc etc etc, so it is ugly. If these were files in a unix filesystem I could throw together something in 10 minutes in bash to do this really elegantly, but its not :-( Any assistance would be appreciated.
I know it is insanely clumsy to do an individual tell for each mailbox, and I did try a "tell mailbox {"chronicle", "svn", "opsnotify"}, but the repeat kept failing with an integer error. So I know I've just missed something on that front.
On the message move front, I can fairly easily get it to move a message to the "work archive" main mailbox, but can't figure out a way to specify the actual subfolder I want the mail in.
tell application "Mail" tell mailbox "Inbox" tell mailbox "chronicle" repeat with eachMessage in "chronicle" set read status of (every message whose read status is false) to true end repeat end tell tell mailbox "svn" repeat with eachMessage in "svn" set read status of (every message whose read status is false) to true end repeat end tell tell mailbox "opsnotify" repeat with eachMessage in "opsnotify" set read status of (every message whose read status is false) to true end repeat end tell end tell end tell end tell
Many thanks
Konrad |