Select one mail from Applemail's conversation

Hi all,

is there a way to select one email from Applemail’s conversation?

This code works well, if the conversation only contains a single email:

tell application "mail"
set messagesList to selection
end tell

However, when a conversation consists of more than one email, the messagesList will contain all messages within the conversation, regardless wether or not a single email within the conversation is highlighted or not.

Any help would be greatly appreciated.



the most recent message of a conversation is always the first message

tell application "Mail"
	set messagesList to selection
	if messagesList is not {} then
		set selectedMessage to item 1 of messagesList
		set selectedMessage to missing value
	end if
end tell