- Notifications
You must be signed in to change notification settings - Fork0
Navigating System Prefences/Settings on macOS
License
jaywcjlove/SystemSettings-URLs-macOS
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
In macOS, the URL Schemes for commonly used System Settings panes are stored in theSidebar.plist file, which can be found at the following path:
/System/Applications/System Settings.app/Contents/Resources/Sidebar.plistIn Swift, you can open the corresponding System Settings pane directly by simply adding thex-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 thestrings command to extract strings from the System Settings app that may belong to deeper submenus.
forprefin$( \ strings"/System/Applications/System Settings.app/Contents/MacOS/System Settings"| \ awk'/^com.apple./ {print $1 }' \);doecho"$pref";done
Here is the output of the command above:
com.apple.systempreferences.debugcom.apple.ClassroomSettingscom.apple.CD-DVD-Settings.extensioncom.apple.preferences.ClassKitPreferencePanecom.apple.Passwordscom.apple.LoginItems-Settings.extensioncom.apple.Passwords-Settings.extensioncom.apple.Transfer-Reset-Settings.extensioncom.apple.Date-Time-Settings.extensioncom.apple.SystemProfiler.AboutExtensioncom.apple.Startup-Disk-Settings.extensioncom.apple.Software-Update-Settings.extensioncom.apple.Localization-Settings.extensioncom.apple.Coverage-Settings.extensioncom.apple.Sharing-Settings.extensioncom.apple.AirDrop-Handoff-Settings.extensioncom.apple.settings.Storagecom.apple.Time-Machine-Settings.extensioncom.apple.ExtensionsPreferencescom.apple.Profiles-Settings.extensioncom.apple.systempreferences.GeneralSettingscom.apple.settings.PrivacySecurity.extensioncom.apple.Battery-Settings.extensioncom.apple.Touch-ID-Settings.extensioncom.apple.systempreferences.AppleIDSettingscom.apple.FollowUpSettings.FollowUpSettingsExtensioncom.apple.Family-Settings.extensioncom.apple.Displays-Settings.extensioncom.apple.BluetoothSettingscom.apple.Desktop-Settings.extensioncom.apple.Accessibility-Settings.extensioncom.apple.preference.desktopscreeneffectcom.apple.Wallpaper-Settings.extensioncom.apple.preference.networkcom.apple.Network-Settings.extensioncom.apple.preferences.configurationprofilescom.apple.packagecom.apple.bundlecom.apple.systempreference.prefpanecom.apple.Classroom-Settings.extensioncom.apple.ScreenSaver-Settings.extensioncom.apple.systemsettings.usercachecom.apple.systempreferences.cachecom.apple.HeadphoneSettingscom.apple.systempreference.toggleTouchBarControlStripCustomizationPalettecom.apple.FollowUpSettingscom.apple.Touch-ID-Settingscom.apple.systempreferencescom.apple.Family-Settings.extension*Familycom.apple.Network-Link-Conditionercom.apple.Appearance-Settings.extensioncom.apple.preferencecom.apple.systemsettings.legacyPanecom.apple.systemsettings.extensionscom.apple.Users-Groups-Settings.extensioncom.apple.systemsettings.extensions.didchangecom.apple.settingscom_apple_system_prefs_keywordscom_apple_system_prefs_keywordscom.apple.systempreferences.InstallHelpercom.apple.systempreferences.read-onlycom.apple.systempreferences.refreshdocktilecom.apple.systemsettings.menucachecom.apple.SystemSettings.CoreAnalytics.searchAbandonmentcom.apple.SystemSettings.CoreAnalytics.strugglecom.apple.SystemSettings.CoreAnalytics.navigationcom.apple.SystemSettings.CoreAnalytics.windowResizeforprefin$( \ strings"/System/Applications/Calendar.app/Contents/MacOS/Calendar"| \ awk'/^com.apple./ {print $1 }' \);doecho"$pref";done
Here is the output of the command above:
com.apple.calendarcom.apple.CalendarFileHandlercom.apple.Calendarcom.apple.iCalcom.apple.reminderscom.apple.calendar.viewAtLaunchcom.apple.calendar.viewTransitionscom.apple.calendar.TimeZoneChangedcom.apple.calendar.LocaleChangedcom.apple.calendar.mergeCalendarQueuecom.apple.calendar.continuity.event_selectioncom.apple.calendar.continuity.date_selectioncom.apple.calendar.icscom.apple.ical.icscom.apple.ical.readonlycom.apple.ical.groupcom.apple.ical.invitationcom.apple.ical.nopermissioncom.apple.ical.birthdayscom.apple.ical.itipcom.apple.ical.caldav.readonly.privatecom.apple.ical.reminderscom.apple.ical.itip.receive.requestcom.apple.ical.itip.receive.replycom.apple.ical.itip.sendcom.apple.ical.mailcalendarcom.apple.ical.noeventscom.apple.AddressBookcom.apple.Reminderscom.apple.calendar.restoreQueuecom.apple.mailcom.apple.iCal.automaticInvitationChangecom.apple.calendar.pasteboard.ekcalendarcom.apple.calendar.pasteboard.eksourcecom.apple.iCal.pasteboard.dragOriginDatecom.apple.calendar.weatherCachecom.apple.Siricom.apple.calendar.navigation.modecom.apple.calendar.monthViewEventscom.apple.%@com.apple.suggestionscom.apple.suggestions.settingsChangedcom.apple.eventkit.CalendarDiagnosticExtensioncom.apple.CalendarDiagnostics.CalendarDiagnosticExtensionUnredactedcom.apple.calendar.cal
forprefin$( \ strings"/System/Applications/Reminders.app/Contents/MacOS/Reminders"| \ awk'/^com.apple./ {print $1 }' \);doecho"$pref";done
Here is the output of the command above:
com.apple.calendar.LocaleChangedcom.apple.reminders.deviceListDevicesMutexcom.apple.reminderscom.apple.remindd.userActioncom.apple.reminders.createCSLcom.apple.reminders.boardView.columncom.apple.reminders.helpcom.apple.reminders.sharingextension
You can use the followingAppleScript to find the pane and its associated deeplink anchors: Paste the code intoScript Editor.app, openSystem 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.
tellapplication"System Settings"setAppleScript'stextitem delimitersto","setCurrentPanetotheidofthe current panegetthenameofevery anchorof paneid CurrentPanesetCurrentAnchorstogetthenameofevery anchorof paneid CurrentPanesetthe clipboardto CurrentPanedisplay dialog"Current Pane ID:"& CurrentPane&return&return&"Pane ID has been copied to the clipboard."&return&return&"Current Anchors:"&return& (CurrentAnchorsasstring)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 likelyListenEvent.
tellapplication"Calendar"setbundleIDto uidofapplication"Calendar"end tell-- > "com.apple.iCal"
-- Application pathsetappPathto"/System/Applications/Calendar.app"-- Use PlistBuddy to get CFBundleURLSchemesseturlSchemestodo shell script"/usr/libexec/PlistBuddy -c 'Print :CFBundleURLTypes' '"& appPath&"/Contents/Info.plist'"-- Output the resultreturn urlSchemes
Based on the output, Calendar supports the URL Schemesical:// andwebcal://.
"Array { Dict { CFBundleURLName = Remote Calendar URL CFBundleURLSchemes = Array { webcal } } Dict { CFBundleURLSchemes = Array { ical } CFBundleURLIconFile = ical CFBundleURLName = iCal URL }}"This project is licensed under theMIT License.
Some content in this project is based on the articleHow to Access Every Section of macOS Ventura System Settings by Brian Van Peski.
About
Navigating System Prefences/Settings on macOS
Resources
License
Uh oh!
There was an error while loading.Please reload this page.


