• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Oldest Message in Mail's Trash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Oldest Message in Mail's Trash (From: Luther Fuller <email@hidden>)
 >Re: Oldest Message in Mail's Trash (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Database Events problem
  • Next by Date: Re: Database Events problem
  • Previous by thread: Re: Oldest Message in Mail's Trash
  • Next by thread: Re: Oldest Message in Mail's Trash
  • Index(es):
    • Date
    • Thread