-- Downloaded From: http://c-command.com/scripts/spamsieve/entourage-vacation -- Last Modified: 2007-08-17 property vacationMessage : "I'm out of town and will read and respond to your message when I return." property spamFolderName : "Spam" -- must be a local folder property spamFolderContainerName : "" -- "" means On My Computer property markSpamMessagesRead : false property removeSpamMessagesFromServer : false property tryToMoveIMAPMessages : false tell application "Microsoft Entourage" if not (exists category "Junk") then make new category with properties {name:"Junk", color:{29952, 29952, 29952}} end if set msgs to current messages -- doesn't work without temp variable repeat with m in msgs try set s to m's source tell application "SpamSieve" set isSpam to (looks like spam message s) end tell if isSpam then set category of m to {category "Junk"} if markSpamMessagesRead then set read status of m to read if removeSpamMessagesFromServer and m's online status is fully downloaded then set connection action of m to remove at next connection my moveToSpamFolder(m) else my replyToMessage(m) end if on error e --display dialog "Error in Move Spam" default answer e end try end repeat end tell on moveToSpamFolder(m) tell application "Microsoft Entourage" if spamFolderContainerName is "" then if not (exists folder spamFolderName) then make new folder with properties {name:spamFolderName} end if set destFolder to folder spamFolderName else if not (exists folder spamFolderName of folder spamFolderContainerName) then make new folder with properties {name:spamFolderName, parent:folder spamFolderContainerName} end if set destFolder to folder spamFolderName of folder spamFolderContainerName end if if tryToMoveIMAPMessages then set {theAccount, theSource, theClass} to m's {account, source, class} set ifRead to read status of m make new incoming message at destFolder with properties {account:theAccount, source:theSource, read status:ifRead} delete m else set storage of m to destFolder end if end tell end moveToSpamFolder on replyToMessage(m) tell application "Microsoft Entourage" set newMessage to reply to m without opening window set content of newMessage to vacationMessage send newMessage end tell end replyToMessage