Mercurial > dotfiles
comparison unixSoft/otherbin/Archive Message.applescript @ 215:ca0e1cff654c
Add an applescript I use to archive messages in Mail.app
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 14 Aug 2010 20:42:58 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
214:2a4efba0fe8b | 215:ca0e1cff654c |
---|---|
1 tell application "Mail" | |
2 set selectedMails to the selection | |
3 if the length of selectedMails is greater than 0 then | |
4 repeat with theMessage in selectedMails | |
5 if the name of the mailbox of theMessage is "INBOX" then | |
6 # Set "gmail" to whatever your account is called in Mail.app's preferences | |
7 if the account of the mailbox of theMessage is account "gmail" then | |
8 # Note: instead of "All Mail" below, I had to use "[Gmail]/All Mail" -Simon, using Mail 3.5 (930.3) & Gmail w/ IMAP | |
9 move theMessage to mailbox "[Gmail]/All Mail" in account "Gmail" | |
10 # Add custom accounts with custom names and custom archive mailboxes here | |
11 else if the account of the mailbox of theMessage is account "Google" then | |
12 move theMessage to mailbox "[Gmail]/All Mail" in account "Google" | |
13 else | |
14 say "Your mail didn't belong to any account I know." | |
15 end if | |
16 else | |
17 say "Only mails in inbox can be moved" | |
18 end if | |
19 end repeat | |
20 else | |
21 say "You have to select mails first" | |
22 end if | |
23 end tell |