On 4/25/02 2:03 PM, "Adam Bailey" <[EMAIL PROTECTED]> wrote:

>> Here it is yet again, in HTML, so you won't have line ending problems when
>> pasting into Script Editor:
> 
> I get the same error I got with Barry's script. That's assuming I change
> "sent time" to "time sent" to pass the syntax check.

Oops. sorry about the inversion 'time sent'.

OK, Adam. You didn't mention you are using Entourage 2001. It's always a
good idea to do so - I just checked the Source to find out. This is a good
example of why it's important. Most of the AppleScript answerers here
(Barry, Allen, myself) are all using Entourage X. So when we check out a
script, that's what we're using.

My script with the correction, and Barry's once you piece it together, both
work in Entourage X.

Neither one works in  Entourage 2001, because of a BUG: as I best recall,
'category' does not work in whose clauses for some elements ('contact' is
another one) in E2001. I'm certain about 'contact', I'll check 'message'
next time I'm in OS 9 or Classic. So you'll have to run a repeat loop, which
is  lot slower if you have a full folder with lots of items, but will do the
job. 

This will work. Promise:

------------------------------------------

set sentDate to (current date) - (3 * days) -- will keep updating

tell application "Microsoft Entourage"
    
    set theMsgs to (every message of deleted mail folder whose time sent is
less than sentDate)
    repeat with theMsg in theMsgs
        if category of theMsg contains {category "Junk"} then delete theMsg
    end repeat
    
end tell

---------------------------

Incidentally, there's a another bug in 2001 with equality of dates, so don't
use � (less than or equal).

-- 
Paul Berkowitz


--
To unsubscribe:                     <mailto:[EMAIL PROTECTED]>
archives:       <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to