open an email via AppleScript and message IDs

hi,

I have an AppleScript which can give me the message ID of the selected email in the Mail app.

Now I want an AppleScript which opens the message with this message ID in a new window.

I tried a lot of things but nothing seems to work.
Can someone help me out?

One of my experiments;

tell application “Mail”
if message viewer 1 exists then
tell message viewer 1
set m to message whose message id is “messageID” of inbox
open m
end tell
end if
end tell

Hi,

try this


tell application "Mail"
	set messageID to message id of item 1 of (get selection)
end tell

tell application "Mail"
	if message viewer 1 exists then
		tell message viewer 1
			set m to 1st message whose message id is messageID
			open m
		end tell
	end if
end tell