First AppleScript - Simple Categorizer

R

Rick.Cogley

Hello - I tried my hand at a very simple AppleScript to set the
category of incoming mails when fired via a rule in Entourage 2004. It
checks for From addresses, and subject strings, and sets the category
of mails that match, to "Expiring". The idea is that it will mark
certain mails that get "stale" quickly, after a couple days, and I can
use a view to grab them and then delete them. Keeps the mailbox slim. I
put it up on ScriptBuilders, and will update it as it improves (it can
only improve, I'm sure, as it is a first effort with no error control
or anything).

However, I cannot figure out how to check for "reply to" addresses. Can
someone please advise if that is possible in an applescript?

Cheers,
Rick Cogley
Tokyo Japan


===============================
tell application "Microsoft Entourage"

set theMsg to item 1 of (get current messages)
set theAddress to the sender of theMsg
set theAddressString to the address of theAddress
set theName to the display name of theAddress
set theSubject to the subject of theMsg
set theTargetCategory to category "Expiring"

--List of mail addresses to check
set fromList to {"(e-mail address removed)",
"(e-mail address removed)"}
--List of subject strings to check
set subjectStrings to {"Weather Today", "Junk Mail Alert"}

if (fromList contains theAddressString) or (subjectStrings contains
theSubject) then
set category of theMsg to theTargetCategory
end if

end tell
 
R

Rick.Cogley

Of course, you can do this with multiple vanilla rules in Entourage. I
was trying to just find a simple way to bunch them all into one script
that could execute as a single rule.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top