I am currently trying to customize an AppleScript that is reading the unread Mails in the Inbox. That basically works fine except the fact, that I can#T manage to get the date of the mails.
After about 2 hours of googling around I found out that the Variable I need should be receivedate or deliverydate, but when trying to use one of these I get an error like this:
"...receivedate of id... cannot be converted to Type reference..."
Someone's got an Idea, how I can convert this?
And this is my current code:
tell application "System Events"
set processList to (name of every process)
end tell
if processList contains "Mail" then
tell application "Mail"
if (unread count of inbox) > 0 then
set messageList to (messages of inbox) whose read status is false
set output to "Mails:" & return & return & ""
repeat with itemNum from 1 to (unread count of inbox)
set itemDate to (receivedate of item itemNum of messageList)
set output to output & itemDate & " - " & (extract name from sender of item itemNum of messageList) & return & subject of item itemNum of messageList & return & return
end repeat
end if
end tell
else
set output to "ÄpplMäil isch aus..."
end if