1

On macOS Ventura it is not possible to click on the checkbox "Play user interface sound effects"

tell application "System Settings"
    activate
end tell

tell application "System Events"
    tell process "System Settings"
        click menu item "Sound" of menu "View" of menu bar 1
        delay 1
        click checkbox "Play user interface sound effects" of group 0 of splitter group 0 of window "Sound"
    end tell
end tell

I get such an error:

enter image description here

How can I fix my script?

1 Answer 1

0

This works for me on OS Ventura.

tell application "System Settings" to activate

tell application "System Events" to tell process "System Settings"
    click menu item "Sound" of menu "View" of menu bar 1
    repeat until checkbox "Play user interface sound effects" of group 1 ¬
        of scroll area 1 of group 1 of group 2 of splitter group 1 ¬
        of group 1 of window "Sound" exists
        delay 0.1
    end repeat
    click checkbox "Play user interface sound effects" of group 1 ¬
        of scroll area 1 of group 1 of group 2 of splitter group 1 ¬
        of group 1 of window "Sound"
end tell

tell application "System Settings" to quit
2
  • Eee!)) Thank You very much! How do you know what it is "of group 1 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1"? Couldn't find info anywhere Jan 3, 2023 at 21:28
  • In Automator.app, you can record your actions (Watch Me Do) so that everything you do in System Settings will be recorded 1 by 1. When you finish recording, you can copy that recorded action of clicking that checkbox "Play user interface sound effects" to your clipboard and paste it into a Script Editor document and you will see the info you need.
    – wch1zpink
    Jan 3, 2023 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .