Title: Re: Executing a Rule from a schedule?
So Allen’s solution is 17 lines, and Paul’s is 3.  Just a matter of style, or something more profound?

-- Joshua

On 2/23/04 3:04 PM, "Allen Watson" <[EMAIL PROTECTED]> wrote:

Really, the only tricky part is calculating the date and accessing the categories; that requires a little AS know-how. But it's simple once you know how.


tell application "Microsoft Entourage"
    set ThirtyDaysAgo to ((current date) - 30 * days)
    set msgList to every message of in box folder whose (time sent � ThirtyDaysAgo)
    set newmsglist to {}
    repeat with j from 1 to (count msgList)
        set aMsg to item j of msgList
        set c to category of aMsg
        repeat with i from 1 to (count c)
            set theCat to item i of c
            if theCat = category "Web Order" then
                copy aMsg to end of newmsglist
                exit repeat
            end if
        end repeat
    end repeat
    move newmsglist to folder "Orders"
end tell


If the last line does not work for you, remove it and replace the line starting “copy” with:

    move aMsg to folder “Orders”

I forget where it became possible to script moving an entire list of messages, so you may have to use the latter version which moves them individually.

On or near 2/23/04 2:15 PM, Mark Goodman at [EMAIL PROTECTED] observed:

> 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.
>
>
>> 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.
>
> ***********************************************************************
>
> on 2/23/04 9:18 AM, Allen Watson <[EMAIL PROTECTED]> wrote:
>> Again, no. Best you can do is write a script that does what the rule does,
>> then use a schedule to run the script.
>
>
>
>> On or near 2/23/04 2:43 AM, Mark Goodman at [EMAIL PROTECTED] observed:
>>> Executing a Rule from a schedule?
>>>
>>> It would be very helpful to have this feature.
>
>
>


Reply via email to