用于选择系统首选项的Apple脚本 - >通知 - >警报风格

时间:2014-09-03 13:02:12

标签: macos applescript

我正在尝试使用Applescript来更改警报类型。

我尝试了以下代码,附加了屏幕截图供参考。

tell application "System Preferences"
    activate
    set the current pane to pane id "com.apple.preference.notifications"
end tell
tell application "System Preferences"
    reveal pane id "com.apple.preference.notifications"
end tell
tell application "System Events" to tell window 1 of process "System Preferences"
    repeat with r in rows of table 1 of scroll area 1
        if name of UI element 1 of r is "NotiNoti" then
            set selected of r to true
            exit repeat
        end if
    end repeat
    --click checkbox "Badge app icon" of group 1
    click radio button "AXNotificationCenterAlert" of group 1

end tell

enter image description here

Key 应该选择单选按钮(请为每个按钮提供按键)?

1 个答案:

答案 0 :(得分:0)

它适用于这一行变化:

click radio button "Alerts" of radio group 1 of group 1

如果您想使用其他人,请使用以下任何一项:

"None" or "Banners" or "Alerts"