Assigning categories in Entourage 2008

0 Comments
My first blog post. The clever commentary on the state of ecommerce will have to wait. Below is an Entourage 2008 applescript that allows one to assign categories to emails/tasks with the keyboard.

tell application "Microsoft Entourage"

set theDialog to display dialog "enter categories" default answer "" buttons {"OK", "Cancel"} default button 1
set theCatNames to text returned of theDialog

set theCats to {}

-- find or make the categories
repeat with theCatName in every word of theCatNames
try
set theCat to item 1 of (every category whose name is theCatName)
on error
set theCat to make new category with properties {name:theCatName}
end try
copy theCat to the end of theCats
end repeat

set selectedMessages to the selection
repeat with theMessage in selectedMessages
set the category of theMessage to theCats
end repeat

end tell

Labels:

0 Comments