Title: Re: Executing a Rule from a schedule?
On 2/23/04 2:15 PM, "Mark Goodman" <[EMAIL PROTECTED]> wrote:

> Very frustrating, using rules would be much easier for me. I have had a Mac
> for about 20 years and I have never got a handle on writing those damn
> AppleScripts. Now I am too old to learn anything new. :)
>
> Okay, so will one of you AppleScript gurus give me an example of how to
> create a script that would search in a particular folder for messages that
> are "XXX" days old that have a category of "XXXXXX", and move it to "XXXXXX"
> folder.
>
> ***********************************************************************
>
> This is what I am trying to do:
>
>> Example 1:
> Select messages in the "InBox" that are older than "30 days" and have a
> category that equals "Web Order" and move it to the "Orders" folder.

It? You mean "them"? No need to "select" (meaning "highlight") them either,  right/? I think you just mean:

    move every message in the Inbox which were received (or sent?) more than 30 days ago and which have the "Web Order" category (and perhaps other categories as well) to the "Orders" folder

Correct? That can be done almost literally in AppleScript:

set thirtyDaysAgo to (current date) - (30 * days)
tell application "Microsoft Entourage"
    move (every message in folder "Inbox" whose time received is less than thirtyDaysAgo and its category contains {category "Web Order"}) to folder "Orders"
end tell
 
(You can use 'time sent' rather than 'time received', if you wish. And should definitely do so if these are sent messages you sent out.)


>
>
>> Example 2:
> Select messages in the "InBox" that are older than "30 days" and have a
> category that equals "Fax" and move it to the "Fax Archive" folder.
>
> ***********************************************************************

set thirtyDaysAgo to (current date) - (30 * days)
tell application "Microsoft Entourage"
    move (every message in folder "Inbox" whose time received is less than thirtyDaysAgo and its category contains {category "Fax"}) to folder "Fax Archive"
end tell




Now that wasn't too bad, except for the {category "whatever"} part, was it?


--
Paul Berkowitz

Reply via email to