Re: Selecting mail message by ID
Re: Selecting mail message by ID
- Subject: Re: Selecting mail message by ID
- From: Malcolm Fitzgerald <email@hidden>
- Date: Fri, 15 Apr 2005 14:32:16 +1000
On 15/04/2005, at 8:51 AM, John M, John wrote:
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
this returns a message ID but the searchMail handler returns missing
value everytime.
I'd keep trying but there's not much point. At the other end iCal isn't
going to do what I want. I had thought that I'd work around Mail's
shortcomings by using the description to store the information I needed
from the email. Others have pointed out that the description property
for ToDos is missing. Between the two apps there's enough broken or
missing to stop me from proceeding.
--call handler from outside mail.app
set myMessage to searchMail(messageID)
tell application "Mail" to open myMessage
on searchMail(messageID)
-- 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:
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