Created
November 20, 2012 23:00
-
-
Save lukemartin/4121867 to your computer and use it in GitHub Desktop.
AppleScript: Smart Archive for multiple inboxes in Mail.app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set selected_messages to selection | |
repeat with a_message in selected_messages | |
set a_message_mailbox to name of mailbox of a_message | |
if a_message_mailbox is "INBOX" then | |
tell application "Mail" | |
move the a_message to mailbox "INBOX/Archive" of account "FastMail" | |
end tell | |
else if a_message_mailbox is "anotherinbox" then | |
tell application "Mail" | |
move the a_message to mailbox "INBOX/anotherinbox/Archive" of account "FastMail" | |
end tell | |
else if a_message_mailbox is "onemoreinbox" then | |
tell application "Mail" | |
move the a_message to mailbox "INBOX/onemoreinbox/Archive" of account "FastMail" | |
end tell | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment