The Cheap Geek
Aug 3 / 11:43pm

Apple Mail, Lion, and FastScripts

In this video I give a quick overview of Apple mail in OSX Lion and some of the issues with the newly implemented archive button. I then demo how to use an application called Fast Scripts and a few short Apple scripts to really take control of Apple mail.

In the video I suggested using Shift + A, S, D, or F to trigger the corresponding script. I later found out that Mail.app will still active the scripts while typing a message. Due to the frequent occurrence of typing a capital A, S, D, or F I decided to change the shortcut to ⌘ + shift + A, S, D, or F. The main body of the script is show below, feel free to modify it to your hearts content and check back, when I update the script I will update this post as well.

tell application "Mail"  
 set theSelectedMessages to selection  
if theSelectedMessages = {} then  
beep  
return  
else  
repeat with theMessage in theSelectedMessages  
set theAccount to the account of (mailbox of theMessage)  
if (name of theAccount) is "Test@test.com" then  
set theMailbox to "Archive"  
tell application "Mail"  
move the theMessage to mailbox theMailbox of the account of (mailbox of theMessage)  
end tell  
else  
set theMailbox to "[Gmail]/All Mail"  
tell application "Mail"  
move the theMessage to mailbox theMailbox of the account of (mailbox of theMessage)  
end tell  
end if  
end repeat  
end if  
end tell

0 comments

Leave a comment...