• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Account Mail Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Account Mail Question (From: m <email@hidden>)

  • Prev by Date: Re: Account Mail Question
  • Next by Date: Re: Account Mail Question
  • Previous by thread: Re: Account Mail Question
  • Next by thread: Frontmost Message Viewer
  • Index(es):
    • Date
    • Thread