Re: Eudora users - Did you know that...
Re: Eudora users - Did you know that...
- Subject: Re: Eudora users - Did you know that...
- From: John Delacour <email@hidden>
- Date: Thu, 20 Mar 2003 22:26:08 +0000
- Mac-eudora-version: 6.0a11
At 1:55 pm -0700 20/3/03, Doug McNutt wrote:
Right now I'd like to tell Eudora to select all messages in the
active Mailbox so I can loop through all of them.
If you want every message, you can loop through them without
selecting. This script will simply get a list of all the message
references. The id of the message will never change, though its
mailbox (not a property of it, by the way) may change. On the basis
of this script you will see you have many possibilities.
tell application "Eudora"
set Box to a reference to mailbox ":In"
set msgList to {}
tell Box
repeat with i from -1 to -1000 by -1
set msg to (a reference to message i)
(* msg does not necessarily exist *)
try
set msgid to id of msg
on error -- none left
exit repeat
end try
set msgRef to (a reference to its message msgid)
set end of msgList to msgRef
end repeat
end tell
msgList
end tell
I'd also like to know the difference between a message ID and a
message numeric index. Which, if either, is in use when I refer to
"message 0"? What is the relationship to the RFC 822 Message-ID
header? The dictionary doesn't help a bit and I'm reluctant to ask
here because I don't want an example or a solution to a current
problem. I want an academic answer that will help me to understand.
The index of a window, a document etc. is something that is fluid.
If you open a message, it is message 1 while it is frontmost and
message 2 as soon as you open something in front of it, whereas the
id of the message is a read-only property assigned to it at its
creation in the file and will stay with it. The "Message-ID" is not
a property of the message but simply a header field, which might not
even be there in some illegal messages -- though I'm not sure if they
would travel far.
tell application "Eudora"
set msg to a reference to the front message
--> message 1 of application "Eudora"
set msgid to get msg's id
--> 1.360906726E+9
set msgRef to a reference to message id msgid
--> message id 1.360906726E+9 of application "Eudora"
get field "message-id" of msgRef
-->"Message-Id: <
p05100305ba9fd026eda5@[192.168.1.14]>"
set my text item delimiters to ": "
set headerID to last text item of (get field "message-id" of msgRef)
-->"<
p05100305ba9fd026eda5@[192.168.1.14]>"
end tell
I could thus get a list of all messages from Eudora 5.2 users in my
In mailbox like this:
tell application "Eudora"
set senderList to {}
tell mailbox ":In"
repeat with i from -1 to -1000 by -1
set msg to (a reference to its message i)
try
if field "message-id" of msg contains ": <p052" then
set msgSender to get sender of msg
if msgSender is not in senderList then
set end of senderList to msgSender
end if
end if
on error
return senderList
end try
end repeat
end tell
msgList
end tell
--> {"Emmanuel"}
_______________________________________________
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.