Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on run {input, parameters}
- tell application "System Events"
- activate
- --BEGIN Config
- --You should only need to edit these variables
- set myAccount to "your.email@here"
- set myMailAccounts to {"Inbox", "1 To-Do", "2 Wait", "3 Completed", "Archive"}
- set myDefault to {"1 To-Do"}
- --END Config
- choose from list myMailAccounts with title "Open Mailbox" with prompt "Choose Mailbox" default items myDefault
- set selectedMailbox to result as string
- end tell
- --Activate Mail in case the dialogue box was cancelled out of
- tell application "Mail"
- activate
- end tell
- --loop through options and decide which mailbox was selected
- repeat with i from 1 to count of myMailAccounts
- set this_item to item i of myMailAccounts
- if selectedMailbox is this_item then tell application "Mail"
- --if this mailbox was selected, open it
- activate
- set s to selection
- repeat with eachMessage in s
- move eachMessage to mailbox selectedMailbox of account myAccount
- end repeat
- end tell
- end repeat
- end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement