我正在编写一个简单的代码来单击 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 秒才能完成运行并返回错误缺失值
但是如果我不添加击键或任何命令,则此代码可以完美运行