Anoop Vaidya
Anoop Vaidya

Reputation: 46563

Apple Script to select System Preference -> Notifications -> Alert Style

I am trying an Applescript to change alert type.

I have tried the following code, screen shot attached for reference.

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

What Key should be there to select the radio buttons(please provide keys for each of them)?

Upvotes: 0

Views: 825

Answers (1)

Anoop Vaidya
Anoop Vaidya

Reputation: 46563

It worked with this one line of change:

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

If you want to use others then use any of these :

"None" or "Banners" or "Alerts"

Upvotes: 0

Related Questions