• 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: Luther Fuller <email@hidden>
  • Date: Sat, 29 Dec 2007 15:25:33 -0600

Messages, message viewers, mail attachments and windows can be referred to with an id number.
Your code ...
every message of mailbox "Inbox" whose id is 20863
looks suspicious because it refers a single message with a unique id.


Here is a snippet of code I wrote a couple of years ago, so perhaps I've forgotten the details about what it does and why, but it might be helpful ...
('msg' is a reference to a message)


tell application "Mail"
set mbox to (mailbox of msg)
set msgName to ((id of msg) as text) & ".emlx" -- needed for file alias
try
account of mbox -- THIS DOES NOT WORK FOR MAC ACCOUNT or USER MAILBOXES
set acnt to the result
set acntDir to (account directory of acnt) -- THIS WORKS !!!!!!!!!
set noAccount to false
on error
set noAccount to true
end try


I don't recall the reason for my comments. No doubt you will rediscover them.

On Dec 29, 2007, at 1:56 PM, m wrote:

Hi AppleScripters,
Thank you first of all for all the help so far.

I have one last hurdle.

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
set theAcct to account of  theMsg



This give an immediate error, ( as there is more than one account) of "can't get mailbox "inbox"

I could simply travel up the file hierarchy and search for a string that tells me that this is the account, but I really do wish to use AppleScript terminology as I think it is more accurate.
_______________________________________________
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
  • Follow-Ups:
    • Re: Account Mail Question
      • From: m <email@hidden>
References: 
 >Account Mail Question (From: m <email@hidden>)

  • Prev by Date: Re: Leopard and "new file"
  • Next by Date: Re: Account Mail Question
  • Previous by thread: Account Mail Question
  • Next by thread: Re: Account Mail Question
  • Index(es):
    • Date
    • Thread