in applescript

Quickly file Exchange-based emails using Entourage

Managing the torrential flow of work email used to be an onerous task, but a healthy combination of email habits and scripts simplify the flow greatly. Personal experience has demonstrated that email is best handled with a GTD-inspired triage system, à la this one. Spotlight on the Mac and Copernicus on Windows make dredging up old emails a cinch.

Even with a simplified organization structure, it can be time-consuming (or RSI-inducing) to triage your inbox. I find that when it takes longer than a second or two to file an email, I’m more likely to just leave it in my inbox — defeating the value of the system.

Although Outlook in Windows is my preferred professional email client, I use Entourage for email triage because it’s just faster. With a few simple Applescripts, filing any number of emails is a single keystroke away.

[code lang="AppleScript"]
property destFolderName : "@ACTION"
property exchangeAccountName : "CHCSII"

tell application "Microsoft Entourage" set destFolder to folder destFolderName of Exchange account exchangeAccountName set currMsgs to (current messages) move currMsgs to destFolder end tell[/code]

Save the script as “Action \ca.scpt” in your Entourage Script Menu folder (located in ~/Documents/Microsoft User Data/) and you can activate it instantly with Control-A. Change the “\ca” suffix to change the shortcut.

Bonus #1: Change your Caps Lock key to Control in the Keyboard & Mouse control panel (under “Modifier Keys…”) and the script is even easier to activate.

Bonus #2: If you have Growl installed, add the following code below “end tell” in the above script and you’ll get an unobtrusive confirmation that your email has been filed in the right folder (useful for the oh-shoot-did-I-just-move-that-to-the-right-folder moments):

[code lang="AppleScript"]
tell application "GrowlHelperApp"

set the allNotificationsList to {"General", "Move message", "Error"}
set the enabledNotificationsList to {"General", "Move message", "Error"}

register as application ¬
    "Entourage AppleScripts" all notifications allNotificationsList ¬
    default notifications enabledNotificationsList ¬
    icon of application "Microsoft Entourage"

--  Error Notification...
if (count of currMsgs) is 0 then
    notify with name ¬
        "Error" title ¬
        "Error" description ¬
        "No message selected." application name "Entourage AppleScripts"
end if

--  1 Notification...
if (count of currMsgs) is 1 then
    notify with name ¬
        "General" title ¬
        "Exchange Notification" description ¬
        "1 message moved to " & name of destFolder application name "Entourage AppleScripts"
end if

--  Multi Notification...
if (count of currMsgs) > 1 then
    notify with name ¬
        "General" title ¬
        "Exchange Notification" description ¬
        "" & (count of currMsgs) & " messages moved to " & name of destFolder & "." application name "Entourage AppleScripts"
end if

end tell[/code]

For those with something to say:

Comment