• 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: m <email@hidden>
  • Date: Sat, 29 Dec 2007 14:26:43 -0800

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

 _______________________________________________
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: Luther Fuller <email@hidden>
    • Re: Account Mail Question
      • From: Michelle Steiner <email@hidden>
References: 
 >Account Mail Question (From: m <email@hidden>)
 >Re: Account Mail Question (From: Luther Fuller <email@hidden>)
 >Re: Account Mail Question (From: m <email@hidden>)
 >Re: Account Mail Question (From: Luther Fuller <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: Re: Account Mail Question
  • Index(es):
    • Date
    • Thread