我試圖讓腳本單擊 iCloud 按鈕,但我得到的語法/邏輯不正確。
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preferences.internetaccounts"
delay 1
end tell
tell application "System Events"
tell process "System Preferences"
click button "iCloud" of window "Internet Accounts"
end tell
end tell
非常感謝您的幫助。我在 Monterey (12,4) iMac 上。

uj5u.com熱心網友回復:
嘗試這個。
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preferences.internetaccounts"
end tell
tell application "System Events" to tell process "System Preferences"
repeat until exists of UI element "iCloud" of UI element 1 of row 1 of ?
table 1 of scroll area 1 of group 1 of window "Internet Accounts"
delay 0.1
end repeat
click button "iCloud" of UI element 1 of row 1 of table 1 of scroll area 1 of ?
group 1 of window "Internet Accounts"
end tell
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/494668.html
