Re: repeat loops on Eudora messages
Re: repeat loops on Eudora messages
- Subject: Re: repeat loops on Eudora messages
- From: Charles Arthur <email@hidden>
- Date: Fri, 31 Oct 2003 17:49:16 +0000
On Fri, 31 Oct 2003 12:04:34 -0500, Rob Jorgensen <email@hidden> wrote:
>
JD's method is the only way that I know of to work with selected
>
messages. This will allow you to loop through a mailbox (selected
>
messages have no impact on this).
>
>
tell application "Eudora"
>
tell mailbox "In" of mail folder ""
>
set count_ to number of messages
>
repeat with i from 1 to count_
>
-- do something to/with message i
>
end repeat
>
end tell
>
end tell
Just a small point, but if that "do something to/with message i" includes
moving it to another mailbox, then you'd be better doing the repeat loop as
repeat with i from count_ to 1 by -1
so that you don't finargle up the count of messages in the mailbox, as it
won't be checking the number once you're in the repeat loop there.
Say you had 5 messages and moved number 3, you'd then error when
you tried to "do something" to message number 5, which wouldn't exist as
such. (You could work on the absolute IDs of the emails, but you'd have to
have those in a list, and that'd be a real pain.) Decrementing is safer.
best
Charles
--
----------------------------
http://www.ukclimbing.com : 1100+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. And there's even a cool shop attached.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.