Re: Mail: Finding messages by ID
Re: Mail: Finding messages by ID
- Subject: Re: Mail: Finding messages by ID
- From: kai <email@hidden>
- Date: Fri, 27 May 2005 03:28:18 +0100
On Friday, May 27, 2005, at 02:27 am, Malcolm Fitzgerald wrote:
On 27/05/2005, at 6:02 AM, Todd Geist wrote:
Given either unique identifier for a message, how do you find it?
Nothing I have tried works. Al I want to is find it and open it up.
[snip]
I was trying to get a count of mailboxes, then a count of the
messages in each of those mailboxes. It would work if I asked one
mailbox to do it but it wouldn't work in a repeat loop. I'd get
timeout errors every time. So, I tried the bundled "Count messages of
every mailbox" script. At the same time I did a speed trial. I have 49
mailboxes, so I did mental arithmetic and added 49 numbers in my head.
(3560!) Then I waited for Mail to finish. After a few minutes I
switched to finder and did a force quit on Mail.
As Malcolm says, nothing's going to work too fast within Mail -
considering the number of items usually involved. I suppose you could
try something like this:
----------------
to getMessageRef from messageID
tell application "Mail" to repeat with m in mailboxes
tell (m's first message whose message id is messageID) ¬
to if (count) is 1 then return it
end repeat
end getMessageRef
set messageID to "<insert message id here>"
set messageRef to getMessageRef from messageID
----------------
---
kai
_______________________________________________
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