メッセージの先頭に定義済みのテキストを挿入するアップルスクリプトを作成しようとしています。これは私が現在持っているものです:
set msgClass to (choose from list {"Green", "Blue", "Purple"} with title "Choose:")
if result is false then
stop
else
set msgClasstxt to the result
set msgClasstxt to "Classification: " & msgClasstxt
tell application "System Events"
key code 126 using {command down}
keystroke return
keystroke return
key code 126 using {command down}
end tell
tell application "Microsoft Outlook" to set selection to msgClasstxt
end if
これを行うためのより良い方法があると確信していますが、意図は次のとおりです。
- CMD+Up でホームに戻る
- 空行を 2 行作成する
- 家に帰る
- テキストを挿入
私の問題は、キーストロークが実行される前にテキストが挿入されていることです。うっとうしい。誰でも助けることができますか?