Re: Account Mail Question
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