Re: Mail: Finding messages by ID
Re: Mail: Finding messages by ID
- Subject: Re: Mail: Finding messages by ID
- From: Brett <email@hidden>
- Date: Fri, 10 Jun 2005 20:53:05 -0400
FWIW, Mail (in 10.4) keeps messages in ~/Library/Mail/Mailboxes/
mailbox/messageID.emlx
If you know the message's mailbox then you can access it directly
that way.
On Jun 2, 2005, at 2:37 AM, Jeff Porten wrote:
On May 26, 2005, at 10:28 PM, kai wrote:
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
Whose clauses work great when in conjunction with a strategy of
keeping target messages in small mailboxes. I.e., a trigger script
that moves/copies a message to a followup folder, with a second
script searching that folder.
OTOH, I just managed to give Mail.app the Rainbow Pizza of Death by
doing a test whose against a mailbox with 34,000 messages in it.
For some reason, locate is borked on my clean install of Tiger.
Otherwise, the above script would work like a charm -- provided
your email message was more than 7 days old.
Here's the script to get the file with Spotlight:
set spotlightFile to do shell script "mdfind \"kMDItemFSName == '"
& msgId & ".emlx'\" | grep '/" & msgId & "'"
The grep pipe is necessary so a search for msgID 10000 doesn't also
return msgID 110000 et al.
Best,
Jeff _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to 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