• 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: Luther Fuller <email@hidden>
  • Date: Mon, 26 Sep 2011 14:18:47 -0500

On Sep 26, 2011, at 11:50 AM, Shuba and Karthik wrote:

How do I *select* a message in the message viewer of Apple Mail given the message ID?

Here's a snippet of code that I use ...

tell application "Mail"
activate
try
set frontViewer to (some message viewer whose index is 1)
on error
my showInstruction("A message viewer window must be open and frontmost in Mail.")
return
end try
set msgList to selected messages of frontViewer
try
if (count items of msgList) = 0 then error
set selected messages of frontViewer to {item 1 of msgList}
on error
my showInstruction("You have not selected any messages to save.")
return
end try

In this snippet, item 1 of msgList is of class 'message' where msgList is a list of messages.
I don't know if you can do the selection if all you know is the message id, however,
at some point in your script you had to have a line of code like this ...

set msgID to (id of msg)

Keep msg around so you can select the message.

 _______________________________________________
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

References: 
 >How to select a message in Apple mail, given mail ID? (From: Shuba and Karthik <email@hidden>)

  • Prev by Date: Re: How to select a message in Apple mail, given mail ID?
  • 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