How do I open the System Preferences Panel on a particular tab?

How do i open the System Preferences Panel on a particular tab?

Shell1.Execute ("/usr/bin/open -b /System/Library/PreferencePanes/Security.prefPane")

“Security.prefPane**?Privacy**” seems to no longer work.

Use AppleScript.
E.g. in ScriptEditor use

tell application "System Preferences" to get panes

to get a list of alla available panels.
Now you can navigate to a specific panel with a name like

tell application "System Preferences" to reveal pane id ""

In case you want to still use the shell you may use e.g.

osascript -e 'tell application "System Preferences" to activate' -e 'tell application "System Preferences" to reveal pane id ""'



works fine.

1 Like

A third way:

dim f as folderItem = SpecialFolder.System.child("Library").child("PreferencePanes").child("Security.prefPane")
if f <> nil and f.exists then
  dim sh as new shell
  sh.Execute "open " + f.ShellPath
end if
1 Like

This is what I use. You can call the prefPane directly and the system will do the right thing.

Also, I just tried your command in my Terminal (macOS 12.3.1) and it works fine:
/usr/bin/open -b /System/Library/PreferencePanes/Security.prefPane

@Mike_D @Tim_Jones Does this technique make Apple Security complain that you’re trying to access a folder in /System/Library?

I learned the way @Beatrix_Willius shared, and somewhere buried in my reference notes is a list of the different locations that are valid.

1 Like

Good point: for me it does not cause a security warning, but I have previously set Terminal with Full Disk Access…

I was provided this amazing reference by Norman


Yes it’s work fine but, i want open to a SPECIFIC tab ! Sample : “General” tab, “Filevault” tab, “Firewall” tab or “Privacy” tab.

part 1 : Absolutely not.

1 Like

Thanks you very much work fine ! But how do I get the names of the other tabs? FileVault, Firewall and General tab?
Where do we find the list?

The document linked above has an answer for you:–privacy-pane

1 Like

I found it!