我最近将我的 mac 更新为 Monterey,我的旧 applescript 不再工作,我收到此错误:“系统事件出错:无法弹出进程“系统偏好设置”的窗口 1 的按钮 1。无效的索引。
老实说,我不知道我应该改变哪一部分。先感谢您。
tell application "System Preferences"
set current pane to pane "com.apple.preference.displays"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click pop up button 1 of window 1
click menu item 1 of menu 1 of pop up button 1 of window 1
end tell
end tell
tell application "System Preferences"
delay 10
quit
end tell