Applescript, чтобы включить зеркалирование и выбрать iPad
Я недавно обновил свой 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
1 ответ
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 tell