• 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: How to select a message in Apple mail, given mail ID?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to select a message in Apple mail, given mail ID?


  • Subject: Re: How to select a message in Apple mail, given mail ID?
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 29 Sep 2011 21:28:31 -0500

On Sep 29, 2011, at 09:29, Michelle Steiner wrote:
It appeared to me out of the blue that on Thu Sep 29 00:03:33 2011, Christopher Stone wrote these pearls of wisdom:

tell application "Mail"
tell (some message viewer whose index is 1)
set selected mailboxes to {mailbox "INBOX" of account "geode" of application "Mail"}

Chris,

Is of application "Mail" necessary?  I ask because it is inside tell application "Mail"
______________________________________________________________________

Hey Michelle,

If I pull the 'of application "Mail"' it throws an error:

"Mail got an error: Can’t set account "geode" of some message viewer whose index = 1 to {mailbox "INBOX" of account "geode" of some message viewer whose index = 1}."

Mail viewers understand mailboxes but not accounts, so I had to back the reference out to the application level.

I can write it like this and make Mail happy:

tell application "Mail"
set geodeInbox to mailbox "INBOX" of account "geode"
tell (some message viewer whose index is 1)
set selected mailboxes to {geodeInbox}
set msgList to messages whose read status is false
repeat with theMsg in msgList
set sub to theMsg's subject
end repeat
end tell
end tell

OR

tell application "Mail"
set mailApp to a reference to it
tell (some message viewer whose index is 1)
set selected mailboxes to {mailbox "INBOX" of account "geode" of mailApp}
set msgList to messages whose read status is false
repeat with theMsg in msgList
set sub to theMsg's subject
end repeat
end tell
end tell

--
Best Regards,
Chris

 _______________________________________________
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: How to select a message in Apple mail, given mail ID?
      • From: Michelle Steiner <email@hidden>
References: 
 >How to select a message in Apple mail, given mail ID? (From: Shuba and Karthik <email@hidden>)
 >Re: How to select a message in Apple mail, given mail ID? (From: Ron Hunsinger <email@hidden>)
 >Re: How to select a message in Apple mail, given mail ID? (From: Shuba and Karthik <email@hidden>)
 >Re: How to select a message in Apple mail, given mail ID? (From: Christopher Stone <email@hidden>)
 >Re: How to select a message in Apple mail, given mail ID? (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Show items in the sidebar
  • Next by Date: Re: How to select a message in Apple mail, given mail ID?
  • Previous by thread: Re: How to select a message in Apple mail, given mail ID?
  • Next by thread: Re: How to select a message in Apple mail, given mail ID?
  • Index(es):
    • Date
    • Thread