On 28/9/2004 at 8:59 AM I saw Jim Pistrang type:

>>Is there any way to trigger this without my having to actually QUIT
>>powermail. In normal operation I don't quit very often so the trash tends
>>to build up. A background process that ran on a timed basis (every hour,
>>every 6 hours) that performed this function would be nice. Alternatively,
>>a command that would let me do it manually would suffice (I assume the
>>EMPTY TRASH command deletes everything).
>
>I would also like to see this.

If you can use something to schedule AppleScripts to run at an interval,
then you can use the following script. Change the value of days in the
first line to reflect how many days you would like to save. This also
calculates based on the message date, as I haven't be able to try when
they are moved to the trash. [N.B. I have commented out the actual delete
part of the script as I didn't want messages to be deleted without
testing it first. Remove the -- infront of delete theMessage to play with
fire.]

Programs that I used to know of that would do AppleScripts on a schedule
are iDo and perhaps even Cronnix [though I can't profess any ability with
them.] but I use Spark to map it to a function key for quick fire.

<applescript>
set days to 365

tell application "PowerMail"
        set messageList to the messages in message container "Mail Trash"
        repeat with theMessage in messageList
                set messageDate to time sent of theMessage
                set messageLable to label of theMessage
                if (messageDate < ((current date) - (days * 24 * 3600))) then
                        set label of theMessage to 3
                        --delete theMessage
                end if
        end repeat
end tell
</applescript>

Kename




Reply via email to