How to Get the "First Name" of the Sender from Mail and/or Spark?

Try this:

tell application "Mail"
	set selectedMessages to selection
	if selectedMessages = {} then return
	
	set senderName to extract name from sender of item 1 in selectedMessages
	return senderName
end tell

selection is a list so you must treat it as such.

1 Like