1

私は現在、受信トレイで未読のメールを読んでいる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
4

1 に答える 1

3

あなたが探している用語は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

必要なヘルプをすばやく取得する方法は、 MailのApplescript辞書です。Mailのすべてのコマンド、クラス、およびプロパティは、この辞書にあります。

この辞書を開く1つの方法は、のFileメニューの[辞書を開く]項目を使用することですAppleScript Editor。このアイテムを使用すると、辞書を持つ利用可能なアプリケーションのリストが表示されます。[開く]ボタンを選択Mailしてクリックするか、[参照]ボタンを使用してリストにないアプリケーションに移動します。

辞書を開く別の方法は、AppleScript Editor'sライブラリウィンドウを利用することです。これはWindow、[結果の履歴]および[イベントログの履歴]メニュー項目の下のメニューにあります。[ライブラリ]ウィンドウには、ダブルクリックで辞書を開くことができるデフォルトのアプリケーションのリストが表示されます。

于 2012-11-15T21:02:42.893 に答える