Re: Re: Selecting mail message by ID
Re: Re: Selecting mail message by ID
- Subject: Re: Re: Selecting mail message by ID
- From: "John M, John" <email@hidden>
- Date: Thu, 14 Apr 2005 23:51:20 +0100
A slightly better script than I posted earlier. This iterates through
all the accounts and general local mailboxes and is a lot faster.
--
--get dummy for message ID
tell application "Mail"
--dummy for message ID
set theseMessages to selection
set the messageID to the message id of item 1 of theseMessages
end tell
--call handler from outside mail.app
set myMessage to searchMail(messageID)
tell application "Mail" to open myMessage
-- handler to search Mail.app files for message with message ID
on searchMail(messageID)
tell application "Mail"
repeat with a in accounts
repeat with mb in mailboxes of a
set x to (every message of mb whose message id is messageID)
if length of x is greater than 0 then return (item 1 of x)
end repeat
end repeat
repeat with mb in mailboxes
set x to (messages of mailboxes whose message id is messageID)
if length of x is greater than 0 then return (item 1 of x)
end repeat
end tell
end searchMail
--
Best wishes
John M
_______________________________________________
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