Programmatically Launch Mac System Preferences Screen & # 8594; Sound

Is there a software way to run system settings on a Mac and focus on the soundbar?

If so, is there a software way to default it on the Exit tab?

+4
source share
2 answers

You can use it:

tell application "System Preferences" activate set the current pane to pane id "com.apple.preference.sound" reveal anchor "Output" of pane id "com.apple.preference.sound" end tell 

Adapted from this link .

+5
source

There is an easier way:

 NSURL * url = [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Speech.prefPane"]; [[NSWorkspace sharedWorkspace] openURL:url]; 
+8
source

Source: https://habr.com/ru/post/1486310/


All Articles