Contents of Mail message in front window

You can get the contents of a selected message with

tell application "Mail"
	set myMessage to first item of (get selection)
	set myContent to content of myMessage
end tell

How do you get the contents of a message which has been opened in its own window?

It’s always better to ensure that the process is a frontmost process. Thus, even if “Male” is not already running, but in the previous session you had a message selected, everything will work (as the “Mail” remembers its last selection):


tell application "Mail"
	activate
	set myMessage to first item of (get selection)
	set myContent to content of myMessage
end tell