The following script
tell application “Mail”
activate
set a to selected messages of message viewer 1
end tell
returns something like
{message 2 of mailbox “SWAP” of application “Mail”}
but if I change it to
tell application “Mail”
activate
set a to subject of selected messages of message viewer 1
end tell
it errors