0
我正在嘗試單擊System Prefernces的Displays面板中的單選按鈕,即更改屏幕分辨率。這是我用它來識別單選按鈕的代碼:用AppleScript更改屏幕分辨率
tell application "System Preferences"
activate
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
end tell
tell application "System Events"
tell application process "System Preferences"
set frontmost to true
get every radio button of window 0
--click button 1 of window 0 of application process "System Preferences" of application "System Events"
--click radio button "Scaled" of radio group of window "com.apple.preference.displays"
end tell
end tell
返回的單選按鈕沒有。根據我所看到的,窗口有零個單選按鈕。這導致一個結論,單選按鈕是子窗口的一部分,即顯示子窗口而不是主窗口。我如何導航到這個「子窗口」並單擊單選按鈕?
我調整「選擇行2 ...」得到它的工作的一部分,否則這是偉大的! – sanjihan