私は現在、受信トレイで未読のメールを読んでいるAppleScriptをカスタマイズしようとしています。メールの日付を取得できないという事実を除けば、これは基本的には問題なく機能します。
約2時間グーグルで調べた後、必要な変数の受信日または配信日が必要であることがわかりましたが、これらのいずれかを使用しようとすると、次のようなエラーが発生します。
"...receivedate of id... cannot be converted to Type reference..."
誰かがアイデアを持っています、どうすればこれを変換できますか?
そしてこれは私の現在のコードです:
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