Mine
public text v1 · immutableusing terms from application "Mail"
on perform mail action with messages theSelectedMessages
tell application "Mail"
repeat with eachMessage in theSelectedMessages
set theSender to extract name from sender of eachMessage
display dialog "name:" & theSender
set theAddress to extract address from sender of eachMessage
display dialog "address:" & theAddress
end repeat
end tell
end perform mail action with messages
end using terms from