Re: Oldest Message in Mail's Trash
Re: Oldest Message in Mail's Trash
- Subject: Re: Oldest Message in Mail's Trash
- From: Luther Fuller <email@hidden>
- Date: Thu, 26 Jun 2008 17:14:15 -0500
Here's another way to get the oldest message which seems to return the
correct result.
tell application "Mail"
activate
if (count message viewers) = 0 then make new message viewer
set frontViewer to (some message viewer whose index is 1)
set selected mailboxes of frontViewer to {trash mailbox}
set sort column of frontViewer to date sent column
--
set oldestDate to (date sent of last message of trash mailbox) -- may
not be correct
set dateList to (date sent of every message of trash mailbox whose
date sent ≤ oldestDate) as list
repeat with i from 1 to (count items of dateList)
item i of dateList
if the result < oldestDate then
set oldestDate to the result
end if
end repeat
end tell
display dialog oldestDate as text
But, the possible bug is ...
set oldestDate to (date sent of last message of trash mailbox)
which ought to work, but does not.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden