/SystemSettings-URLs-macOS

Navigating System Prefences/Settings on macOS

MIT LicenseMIT

Using my app is also a way to support me:
Keyzer Vidwall Hub VidCrop Vidwall Mousio Hint Mousio Musicer Audioer FileSentinel FocusCursor Videoer KeyClicker DayBar Iconed Mousio Quick RSS Quick RSS Web Serve Copybook Generator DevTutor for SwiftUI RegexMate Time Passage Iconize Folder Textsound Saver Create Custom Symbols DevHub Resume Revise Palette Genius Symbol Scribe

SystemSettings for MacOS

In macOS, the URL Schemes for commonly used System Settings panes are stored in the Sidebar.plist file, which can be found at the following path:

/System/Applications/System Settings.app/Contents/Resources/Sidebar.plist

In Swift, you can open the corresponding System Settings pane directly by simply adding the x-apple.systempreferences: prefix.

NSWorkspace.shared.open(
    URL(string: "x-apple.systempreferences:com.apple.Wallpaper-Settings.extension")!
)

You can also open it using the open command:

$ open x-apple.systempreferences:com.apple.Passwords
$ open "x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension?Privacy_Advertising"

In System Settings, besides the sidebar items, there are some interfaces that also support URL Schemes, but they are not in that plist file. To get these items, you can use the strings command to extract strings from the System Settings app that may belong to deeper submenus.

System Settings

for pref in $( \
  strings "/System/Applications/System Settings.app/Contents/MacOS/System Settings" | \
  awk '/^com.apple./ {print $1 }' \
); do echo "$pref"; done

Here is the output of the command above:

com.apple.systempreferences.debug
com.apple.ClassroomSettings
com.apple.CD-DVD-Settings.extension
com.apple.preferences.ClassKitPreferencePane
com.apple.Passwords
com.apple.LoginItems-Settings.extension
com.apple.Passwords-Settings.extension
com.apple.Transfer-Reset-Settings.extension
com.apple.Date-Time-Settings.extension
com.apple.SystemProfiler.AboutExtension
com.apple.Startup-Disk-Settings.extension
com.apple.Software-Update-Settings.extension
com.apple.Localization-Settings.extension
com.apple.Coverage-Settings.extension
com.apple.Sharing-Settings.extension
com.apple.AirDrop-Handoff-Settings.extension
com.apple.settings.Storage
com.apple.Time-Machine-Settings.extension
com.apple.ExtensionsPreferences
com.apple.Profiles-Settings.extension
com.apple.systempreferences.GeneralSettings
com.apple.settings.PrivacySecurity.extension
com.apple.Battery-Settings.extension
com.apple.Touch-ID-Settings.extension
com.apple.systempreferences.AppleIDSettings
com.apple.FollowUpSettings.FollowUpSettingsExtension
com.apple.Family-Settings.extension
com.apple.Displays-Settings.extension
com.apple.BluetoothSettings
com.apple.Desktop-Settings.extension
com.apple.Accessibility-Settings.extension
com.apple.preference.desktopscreeneffect
com.apple.Wallpaper-Settings.extension
com.apple.preference.network
com.apple.Network-Settings.extension
com.apple.preferences.configurationprofiles
com.apple.package
com.apple.bundle
com.apple.systempreference.prefpane
com.apple.Classroom-Settings.extension
com.apple.ScreenSaver-Settings.extension
com.apple.systemsettings.usercache
com.apple.systempreferences.cache
com.apple.HeadphoneSettings
com.apple.systempreference.toggleTouchBarControlStripCustomizationPalette
com.apple.FollowUpSettings
com.apple.Touch-ID-Settings
com.apple.systempreferences
com.apple.Family-Settings.extension*Family
com.apple.Network-Link-Conditioner
com.apple.Appearance-Settings.extension
com.apple.preference
com.apple.systemsettings.legacyPane
com.apple.systemsettings.extensions
com.apple.Users-Groups-Settings.extension
com.apple.systemsettings.extensions.didchange
com.apple.settings
com_apple_system_prefs_keywords
com_apple_system_prefs_keywords
com.apple.systempreferences.InstallHelper
com.apple.systempreferences.read-only
com.apple.systempreferences.refreshdocktile
com.apple.systemsettings.menucache
com.apple.SystemSettings.CoreAnalytics.searchAbandonment
com.apple.SystemSettings.CoreAnalytics.struggle
com.apple.SystemSettings.CoreAnalytics.navigation
com.apple.SystemSettings.CoreAnalytics.windowResize

Calendar

for pref in $( \
  strings "/System/Applications/Calendar.app/Contents/MacOS/Calendar" | \
  awk '/^com.apple./ {print $1 }' \
); do echo "$pref"; done

Here is the output of the command above:

com.apple.calendar
com.apple.CalendarFileHandler
com.apple.Calendar
com.apple.iCal
com.apple.reminders
com.apple.calendar.viewAtLaunch
com.apple.calendar.viewTransitions
com.apple.calendar.TimeZoneChanged
com.apple.calendar.LocaleChanged
com.apple.calendar.mergeCalendarQueue
com.apple.calendar.continuity.event_selection
com.apple.calendar.continuity.date_selection
com.apple.calendar.ics
com.apple.ical.ics
com.apple.ical.readonly
com.apple.ical.group
com.apple.ical.invitation
com.apple.ical.nopermission
com.apple.ical.birthdays
com.apple.ical.itip
com.apple.ical.caldav.readonly.private
com.apple.ical.reminders
com.apple.ical.itip.receive.request
com.apple.ical.itip.receive.reply
com.apple.ical.itip.send
com.apple.ical.mailcalendar
com.apple.ical.noevents
com.apple.AddressBook
com.apple.Reminders
com.apple.calendar.restoreQueue
com.apple.mail
com.apple.iCal.automaticInvitationChange
com.apple.calendar.pasteboard.ekcalendar
com.apple.calendar.pasteboard.eksource
com.apple.iCal.pasteboard.dragOriginDate
com.apple.calendar.weatherCache
com.apple.Siri
com.apple.calendar.navigation.mode
com.apple.calendar.monthViewEvents
com.apple.%@
com.apple.suggestions
com.apple.suggestions.settingsChanged
com.apple.eventkit.CalendarDiagnosticExtension
com.apple.CalendarDiagnostics.CalendarDiagnosticExtensionUnredacted
com.apple.calendar.cal

Reminders

for pref in $( \
  strings "/System/Applications/Reminders.app/Contents/MacOS/Reminders" | \
  awk '/^com.apple./ {print $1 }' \
); do echo "$pref"; done

Here is the output of the command above:

com.apple.calendar.LocaleChanged
com.apple.reminders.deviceListDevicesMutex
com.apple.reminders
com.apple.remindd.userAction
com.apple.reminders.createCSL
com.apple.reminders.boardView.column
com.apple.reminders.help
com.apple.reminders.sharingextension

Finding Pane IDs and Anchors

You can use the following AppleScript to find the pane and its associated deeplink anchors: Paste the code into Script Editor.app, open System Preferences and navigate to the pane you want to identify, then run the script. It will output the name of the current pane and any associated anchors.

tell application "System Settings"
	set AppleScript's text item delimiters to ", "
	set CurrentPane to the id of the current pane
	get the name of every anchor of pane id CurrentPane
	set CurrentAnchors to get the name of every anchor of pane id CurrentPane
	set the clipboard to CurrentPane
	display dialog "Current Pane ID: " & CurrentPane & return & return & "Pane ID has been copied to the clipboard." & return & return & "Current Anchors: " & return & (CurrentAnchors as string)
end tell

$ open "x-apple.systempreferences:com.apple.Wallpaper-Settings.extension?ScreenSaver"

This script does not capture all the anchors that can be deep-linked to. If some anchors are missing, you may need to dig into the preference pane itself to see if there are any code snippets referencing other available options that we cannot identify as anchors. For example, when the script is run against the "Security & Privacy" pane, it doesn't return any options for the "Input Monitoring" section. However, you can open /System/Library/PreferencePanes/Security.prefPane/Contents/Resources/PrivacyTCCServices.plist and see that the key value I might be looking for is likely ListenEvent.

Get the app's bundle ID

tell application "Calendar"
	set bundleID to uid of application "Calendar"
end tell

-- > "com.apple.iCal"

Get URL Schemes for a Specific App

-- Application path
set appPath to "/System/Applications/Calendar.app"

-- Use PlistBuddy to get CFBundleURLSchemes
set urlSchemes to do shell script "/usr/libexec/PlistBuddy -c 'Print :CFBundleURLTypes' '" & appPath & "/Contents/Info.plist'"

-- Output the result
return urlSchemes

Based on the output, Calendar supports the URL Schemes ical:// and webcal://.

"Array {
    Dict {
        CFBundleURLName = Remote Calendar URL
        CFBundleURLSchemes = Array {
            webcal
        }
    }
    Dict {
        CFBundleURLSchemes = Array {
            ical
        }
        CFBundleURLIconFile = ical
        CFBundleURLName = iCal URL
    }
}"

License

This project is licensed under the MIT License.

Some content in this project is based on the article How to Access Every Section of macOS Ventura System Settings by Brian Van Peski.