Notes アプリケーションで共有ボタンをクリックするための簡単なコードを作成しました。
set upArrow to ASCII character 30
activate application "Notes"
tell application "System Events"
tell process "Notes"
set frontmost to true
click button 2 of group 2 of splitter group of window 1
keystroke upArrow
keystroke return
end tell
end tell
問題は
click button 2 of group 2 of splitter group 1 of window 1 of application process "Notes" --> missing value
これを実行してエラー欠損値を返すには6秒が必要です
しかし、キーストロークまたはそれに続くコマンドを追加しない場合、このコードは完全に機能します