Hi Luther and Michelle, Appreciate the help offered and also Michelle's gentle admonition to use the dictionary! :-)
Perhaps you can help me understand this. The reason I keep coming back to the "ID" ( dictionary definition is: id (integer, r/o) : The unique identifier of the message.) is that I can easily obtain this from the actual name of the e-mail in the utility I am writing. ( as in 4521.emlx) I am using AppleScript ( clearly not well :-) ) to move e-mails around so that I can let Mail know that emails have been moved, instead of deleting the envelope index and reindexing all the emails). So, I hope that puts it into some perspective.
The puzzle is this.
To move an email from an "On my Mac" mailbox to another "On my Mac' mailbox, this works.
Tell Application "Mail" set theMsgs to every message of mailbox "Foo" whose id is 10000 set theMsg to first item of theMsgs move theMsg to mailbox "Foo_Duplicates" End Tell
However, the same script will not move an e-mail from an "INBOX" to the same destination without the addition of the account, as in
set theMsgs to every message of mailbox "INBOX" of account "BAR" whose id is 10000
Now it might very well be that I am going down a path that cannot be obtained, in which case I will have to change my approach, but if you can help me understand the difference between the two situations, I may be able, with your help, figure it out.
Thank you for sticking to this...
On Dec 29, 2007, at 3:42 PM, m wrote:
I guess I would ask you and others who are more knowledgeable than I, if , because every message in the Mail App has a uniqueID ( and I mean the mail ID,not the message-ID), does it not know which account it is in?
No, a message does not know which account it is in. A message DOES know which mailbox it is in. SOME, but not all, mailboxes do belong to an account. (That's the reason for the try block.) Mailboxes created by the user "On My Mac" do not belong to any account. You can create a mailbox belonging to an imap account. You cannot create a mailbox belonging to a pop account. (Try it!)
Mail's dictionary does not know what a "mail ID" is. (I looked.)
My advice on message id numbers ... avoid using them. The only necessary use I've found (so far) is to construct the file name of the file that is the message. As in ... set msgName to ((id of msg) as text) & ".emlx" -- needed for file alias
|