AppleScript Navigate through MacOS 13 (Ventura) system preferences?
Asked Answered
F

3

6

One new feature of macOS 13 Ventura is the new layout and design of the system preferences. However, this caused many of my automation scripts to stop working.

Does anyone know how to navigate through the new system preferences? To be precise, what is the equivalent to the following code which is compatible with macOS 13 Ventura?

tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.sound"
end tell

The code above worked with old versions fine, but shows

execution error: System Settings got an error: AppleEvent handler failed. (-10000)

in macOS 13 Ventura

Femme answered 29/10, 2022 at 19:8 Comment(0)
I
2

I've encountered the same issue, it seems to be a known issue, and it was also discussed at https://gist.github.com/rmcdongit/f66ff91e0dad78d4d6346a75ded4b751?permalink_comment_id=4286384

What you're looking for is:

do shell script "open x-apple.systempreferences:com.apple.Sound-Settings.extension"

However, manipulating that screen is another pickle.

Ingamar answered 3/11, 2022 at 9:0 Comment(2)
Is this the new "official" solution or a workaround?Femme
I doubt it's official, I suspect a new minor revision update will change things yet again...Ingamar
S
1

The nomenclature of the pane id has changed:

set current pane to pane id "com.apple.Sound-Settings.extension"
Sopor answered 18/4, 2023 at 19:6 Comment(2)
Is there a way to discover the pane ids?Prepay
You can use Accessibility Inspector and highlight the tab item on the left column with the "Target an element" tool and the pane id will be displayed under the "Advanced" section as "Identifier"Thurlow
A
0

Does it have to be AppleScript or is bash okay? If bash is an option, you can use the open command. To your specific ask, you can use the following to open Sound preferences:

open x-apple.systempreferences:com.apple.Sound-Settings.extension

More details can be found here: https://www.macosadventures.com/2022/12/05/how-to-open-every-section-of-macos-ventura-system-settings/

Atrophied answered 11/12, 2022 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.