我最近更新了我的mac到蒙特利,我的旧的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

发布于 2021-11-13 13:55:56
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
activate
end tell
tell application "System Events"
tell application process "System Preferences"
click pop up button "Add Display" of window "Displays"
click menu item 2 of menu 1 of pop up button "Add Display" of window "Displays"
end tell
end tell
tell application "System Preferences"
delay 5
quit
end tellhttps://stackoverflow.com/questions/68669966
复制相似问题