Skip to content

Instantly share code, notes, and snippets.

@lukemartin
Created November 20, 2012 23:00
Show Gist options
  • Save lukemartin/4121867 to your computer and use it in GitHub Desktop.
Save lukemartin/4121867 to your computer and use it in GitHub Desktop.
AppleScript: Smart Archive for multiple inboxes in Mail.app
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