-
-
Save ftroncosom/c9528e657e4ac204e88e2e0804d9130b to your computer and use it in GitHub Desktop.
macOS: Open system preferences at a specified pane using Swift (or Objective-C) using x-apple.systempreferences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Applescript: tell application "System Preferences" to get anchors of current pane | |
// Result: | |
// { anchor "Privacy_Reminders" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Privacy_SystemServices" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Privacy_Calendars" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Firewall" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Privacy_Assistive" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Privacy_LinkedIn" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Privacy_Accessibility" of pane id "com.apple.preference.security" of application "System Preferences", | |
// anchor "Privacy_Contacts" of pane id "com.apple.preference.security" of application "System Preferences", | |
// ... | |
let prefsURL = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility")! | |
NSWorkspace.shared.open(prefsURL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment