The term you are looking for is date received
tell application "Mail" to if running then
if (unread count of inbox) > 0 then
set output to "Mails:" & return & return & ""
repeat with thisMsg in (get messages of inbox whose read status is false)
tell thisMsg to set output to output & (date received) & " - " & (extract name from sender) & return & subject & return & return
end repeat
end if
else
set output to "ÄpplMäil isch aus..."
end if
A quicker way to get the help you need is the Applescript dictionarie of Mail. All commands, classes and properties of Mail are in this dictionary.
One way of opening this dictionary is to use the Open Dictionary item in the File
menu of AppleScript Editor
. When you use this item, you will get a listing of the available applications that have dictionaries. Choose Mail
and click the Open button or use the Browse button to navigate to an unlisted application.
Another way to open a dictionary, is to make use of AppleScript Editor's
Library window. It's located in the Window
menu below the Result History and Event Log History menu items. The Library window shows a list of default applications whose dictionaries you can open with a double click.