2

Apple メールを開かずにメールを送信する方法を検索したところ、AppleScript - メールアプリを開かずにメールを送信する方法という質問が見つかりました。

ただし、これは Keyboard maestro で行っているため、任意のアプリケーションでホット キーを使用して特定の電子メールを送信できます。解決策をグーグルで検索した後、うまく機能する次のスクリプトを見つけました。

tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:"hello", content:"You got a new file in your Downloads folder, girl!", visible:true}
tell theNewMessage
    make new to recipient at end of to recipients with properties {address:"myemail@mail.com"}
    send
end tell

終わりを告げる

1 つの問題: これを実行したいのですが、件名のhelloの代わりに、 clipboardが必要です。そのためにグーグルで、私は2つのことを見つけました

keystroke "v" using {command down}

また

return (the clipboard)

その二人に「こんにちは」を入れてみました。しかし、どれも機能しません。

私はapplescriptを知らないので、グーグルで調べて、ここで質問します。

4

2 に答える 2

0

これは、たまたま私にとって非常にうまく機能するスクリプトです。一例として載せておきます。

tell application "System Events"
    activate application "Mail"
    set the clipboard to "Subject Line"
    keystroke "v" using command down
    keystroke tab
    set the clipboard to "This is the contents.\nLine 2 of the contents."
    keystroke "v" using command down
end tell

このスクリプトは、ブラウザで電子メール アドレスをクリックした後に使用します。テキスト挿入ポイントが電子メールの件名にあることを確認した後、AppleScript メニューから関連する Mail スクリプトを選択します。

于 2013-08-05T10:02:27.400 に答える