Re: Getting a 'repeat with' to reverse its order in Mail
Re: Getting a 'repeat with' to reverse its order in Mail
- Subject: Re: Getting a 'repeat with' to reverse its order in Mail
- From: deivy petrescu <email@hidden>
- Date: Wed, 22 Jun 2005 22:38:33 -0400
On Jun 22, 2005, at 21:32, Charles Buckett wrote:
If I use the construction:
tell application "Mail"
set theMailcrate to mailbox "AS-Users"
repeat with aMessage in (every message of theMailcrate)
get some data from each message and do something with it
end repeat
end tell
The messages are traversed from the most recent to the oldest
message of the mailbox. But, I need the data to come as oldest to
newest. I know I could do it with a loop counter, but that's messy
compared to the simply elegant 'repeat with.' I tried using 'the
reverse of' in various places without any luck.
Is there any way to reverse the direction of 'repeat with'?
(my Buckett's got a hole in it).
Charlie
Charlie, I think you mean this:
<pseudo script>
tell application "Mail"
set theMailcrate to mailbox "AS-Users"
repeat with aMessage in (reverse of (get every message of
theMailcrate) )
get some data from each message and do something with it
end repeat
end tell
</pseudo script>
Hope this helps.
deivy petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden