• 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: Getting a 'repeat with' to reverse its order in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Getting a 'repeat with' to reverse its order in Mail (From: Charles Buckett <email@hidden>)

  • Prev by Date: Why is the Finder not recordable?
  • Next by Date: Re: Why is the Finder not recordable?
  • Previous by thread: Re: Getting a 'repeat with' to reverse its order in Mail
  • Next by thread: SOAP basic authentication
  • Index(es):
    • Date
    • Thread