Re: Account Mail Question
Re: Account Mail Question
- Subject: Re: Account Mail Question
- From: Michelle Steiner <email@hidden>
- Date: Sat, 29 Dec 2007 14:45:54 -0700
On Dec 29, 2007, at 12:56 PM, m wrote: I need to derive the account of an email from it's unuique Mail Id.
Something like:
set theMsgs to every message of mailbox "Inbox" whose id is 20863
set theMsg to item 1 of theMsgs Well, first of all, you don't have to specify a mailbox. the ID is unique; there never will be more than one message with the same ID, regardless of which mailbox it is in. You do have to specify a message viewer, though.
tell application "Mail" tell message viewer 1 set theMSG to first item of (get messages whose id is 20863) end tell end tell set theAcct to account of theMsg
Messages do not have accounts. Look at the entry for message in mail's Applescript dictionary; there is no account property or element. You are trying to get something that doesn't exist. You might be able to indirectly get the account from the recipients though.
tell application "Mail" tell message viewer 1 set theMSG to first item of (get messages whose id is 783029) {name, address} of recipients of theMSG end tell end tell
Luther Fuller's suggestion might work out better for you, though.
-- Michelle --
We're given a choice in our lives, to make things better, or worse, or merely endure like Sheep. I choose to make things better, as much as I can. -- Mercedes Lackey
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden