0

2012 年 12 月、この stackoverflow サイトの Mark Hunte は、次の AppleScript を提供して別のユーザーを支援しました。スクリプトは、新しい電子メール メッセージを作成します。最後にファイルを添付します。

ここで誰か助けてくれませんか?このスクリプトの短縮バージョンが必要です。これは、「selectedPhoto.jpg」という名前のファイルを、既に開いている電子メールの末尾に添付するという 1 つのことだけを行います。

つまり、新しい電子メールを作成するか、電子メールに返信するときに、既にウィンドウが開いている場合、その電子メールの末尾に写真を添付するだけのスクリプトを実行したいと考えています。

次のスクリプトの行を取り出してみましたが、動作しません。

OS X 10.8 を実行しています

誰か助けてくれませんか?


set theAttachment1 to POSIX file "/Users/USERNAME/Desktop/Desktop--IMAGE/scooter-6.jpg"

tell application "Mail"
    set newMessage to make new outgoing message with properties {subject:"subject", content:"the_content" & return & return}
    tell newMessage

        set visible to false
        set sender to "myaddress@btinternet.com"
        make new to recipient at end of to recipients with properties {address:"someAddress@btinternet.com"}
        make new attachment with properties {file name:theAttachment1} at after the last paragraph

        (* change save to send to send*)
        save --<<<<---------------- change save to send to send
        (* change save to send to send*)
    end tell
end tell

4

1 に答える 1