• 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: selecting a message in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: selecting a message in Mail


  • Subject: Re: selecting a message in Mail
  • From: Jim Brandt <email@hidden>
  • Date: Fri, 18 Sep 2009 20:15:27 -0500

Axel,

OK, I'll look into the Message Viewer.

Thanks

Jim


On Sep 18, 2009, at 7:33 PM, Axel Luttgens wrote:

Hello Jim,

You're right, there's no select command in Mail's dictionary.
Let's remember that usually, a scripting model tends to allow for the
automation of tasks otherwise performed by hand.
In this case, selecting messages happen thru a message viewer.
And, indeed, the dictionary shows:

message viewer n [inh. item] : Represents the object responsible for
managing a viewer window
elements
contains messages; contained by application.
properties
[...]
selected messages (list of message) : List of messages currently
selected
[...]


So, a message viewer has a selected messages property, and that
property seems to be a settable one.
The problem should thus be reduced to building the list of messages to
be selected.
This one works here (changing the domain of your email address, so as
to preserve the innocent):

	tell application "Mail"
		messages of mailbox "•Lists/applescript-users" whose sender
contains "email@hidden"
		tell front message viewer to set selected messages to result
	end tell

HTH,
Axel

_______________________________________________ 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
  • Prev by Date: Re: Applescript Editor preferences
  • Next by Date: Re: Applescript Editor preferences
  • Previous by thread: Re: selecting a message in Mail
  • Next by thread: Re: selecting a message in Mail
  • Index(es):
    • Date
    • Thread