Error when opening a PreferencePane on MacOS 14

Our application guides the user to install a profile by using the code below.

NSWorkspace.SharedWorkspace.OpenFile("/System/Library/PreferencePanes/Profiles.prefPane");

The code works fine on MacOS 13 and below. However, on MacOS 14 Sonoma, instead of "Profiles" pane, the "Privacy & Security" pane opened.

Both /System/Library/PreferencePanes/Profiles.prefPane & System/Library/PreferencePanes/Security.prefPane goes to "Privacy & Security"

... but what we want is to directly open "Profiles".

Any idea?

System Preferences Settings changed a lot in macOS 13. While opening a .prefPane file was long-standing behaviour, it was never actually documented to perform this action.

You’re not the only person to be hit by issues like this, and to help folks along we recently documented an API to open preference panes. Check out the info in <EndpointSecurity/ESClient.h>.

The drawback to this approach is that there’s no list of supported preference pane IDs. You’ll find various lists of those lurking on the ’net, but if you need a specific one to be documented, and thus gain long-term support, I encourage you to file an enhancement request along those lines.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Bug number: 13284344

Since the .prefPane file is broken, one can use the URL "x-apple.systempreferences:com.apple.Profiles-Settings.extension" instead.

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

Or in terminal simply:

open "x-apple.systempreferences:com.apple.Profiles-Settings.extension"
Error when opening a PreferencePane on MacOS 14
 
 
Q