Opening specific panes in system settings using the command line in macOS
I often find myself needing to access specific system settings panes via the command line or a script, but not often enough to remember how to do it. It happens infrequently, yet it’s frustrating every time I have to search for the information again. That’s why I’m writing this article, even though others have already covered the topic – it’s mainly for my own benefit. So yes, this post is a bit selfish, but hopefully, it helps others in the same boat.
If you’re looking for the main information, you can go to Opening with URL Schemes to skip my explanation for why I need it today. With that out of the way, I have been using my iPad as a secondary monitor and it’s great, what’s not great is having to go into displays to extend to the iPad every day. I thought I could automate this process using Keyboard Maestro, which I have now done successfully.
Keyboard Maestro Automation
To download the file you can find it on my Github.
I needed the open specific panes so we can go directly to the displays pane. Then keyboard maestro will wait before moving the mouse to the + button that I screenshot (you should too). It then waits another second before clicking on the name of the device to connect to, this is another screenshot. It then waits another second and quits system settings.

Opening with URL Schemes
If the preference pane supports it, you can open them with a URL in terminal using the following syntax (replace <PaneID> with the desired pane ID):
open "x-apple.systempreferences:<PaneID>"ZshOpen with System Preferences Bundle Identifier and Pane Path
You can also access the main preference panes using the file path to each pane from /System/Library/PreferencePanes/ using the open command with slightly different syntax (replace /Path/To/Pane with your desired pane):
To open a specific pane use the following for the general syntax:
open /System/Library/PreferencePanes/<PANE_NAME>.prefPane
or
open -b com.apple.systempreferences /Path/To/Pane
ZshHere’s an example for the Displays pane:
open /System/Library/PreferencePanes/Displays.prefPaneZshPreference Panes
Below are all the panes that display on most Macs running macOS 14 Sonoma but there are a few that are ommitted that are available on later versions of Apple hardware or installed plugins. If the pane supports being opened with URL then it is listed, otherwise you can use the path.
Here’s a list of all the possible panes and their respective commands:
- Accounts
open /System/Library/PreferencePanes/Accounts.prefPaneZsh- AirDrop and Handoff
open x-apple.systempreferences:com.apple.AirDrop-Handoff-Settings.extensionZsh- Appearance
open /System/Library/PreferencePanes/Appearance.prefPaneZsh- Apple ID
open /System/Library/PreferencePanes/AppleIDPrefPane.prefPaneZsh- Battery
open /System/Library/PreferencePanes/Battery.prefPaneZsh- Bluetooth
open /System/Library/PreferencePanes/Bluetooth.prefPaneZsh- ClassKit (Requires Apple School Manager Apple ID Enrollment)
open /System/Library/PreferencePanes/ClassKitPrerencePane.prefPaneZsh- Classroom Settings (Requires Apple School Manager Apple ID Enrollment)
open /System/Library/PreferencePanes/ClassroomSettings.prefPaneZsh- Date and Time
open x-apple.systempreferences:com.apple.Date-Time-Settings.extensionZsh- Desktop Screen Effects (Wallpaper)
open /System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPaneZsh- CD and DVDs
open /System/Library/PreferencePanes/DigiHubDiscs.prefPaneZsh- Displays
open /System/Library/PreferencePanes/Displays.prefPaneZsh- Dock
open /System/Library/PreferencePanes/Dock.prefPaneZsh- Family Sharing
open /System/Library/PreferencePanes/FamilySharingPrefPane.prefPaneZsh- Internet Accounts
open /System/Library/PreferencePanes/InternetAccounts.prefPaneZsh- Keyboard
open /System/Library/PreferencePanes/Keyboard.prefPaneZsh- Localization
open x-apple.systempreferences:com.apple.Localization-Settings.extensionZsh- Login Items
open x-apple.systempreferences:com.apple.LoginItems-Settings.extensionZsh- Mouse
open /System/Library/PreferencePanes/Mouse.prefPaneZsh- Network (This opens the Wi-Fi pane)
open /System/Library/PreferencePanes/Network.prefPaneZsh- Network (This opens the network pane)
open x-apple.systempreferences:com.apple.Network-Settings.extensionZsh- Notifications
open /System/Library/PreferencePanes/Notifications.prefPaneZsh- Passwords
open /System/Library/PreferencePanes/Passwords.prefPaneZsh- Printers and Scanners
open /System/Library/PreferencePanes/PrintAndScan.prefPaneZsh- Profiles (Opens the privacy and security pane)
open /System/Library/PreferencePanes/Profiles.prefPaneZsh- ScreenTime
open /System/Library/PreferencePanes/ScreenTime.prefPaneZsh- Screen & System Audio Recording (ScreenCapture)
open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"Zsh- Security
open /System/Library/PreferencePanes/Security.prefPaneZsh- Software Update
open x-apple.systempreferences:com.apple.Software-Update-Settings.extensionZsh- Startup Disk
open x-apple.systempreferences:com.apple.Startup-Disk-Settings.extensionZsh