覚えたばかりのAppleScriptが動かなくて、ハマり倒したのでメモしておきます。まず動かなかったのは以下のコードで、やろうとしてるのは一番新しい送信ボックス中のメールに返信する形で新しいメールを作って件名と本文に適当な文字列を設定すると言うことです。単純ですね。
on run tell application "Mail" set last_msg to the first message of sent mailbox set reply_msg to reply last_msg with opening window tell reply_msg set subject to "replied" set content to "this is replied message" end tell end tell end run
パッと見は動きそうなのですが、実行するとsubjectの設定でAppleEvent handler failedという謎のエラーが出ます。replyではなくて新しくメールを作った場合は動作するので、さっぱり原因が予想できず自己解決できませんでした。
