3

In Yosemite it is possible to open System Preferences on a specific pane and tab by opening a URL like x-apple.systempreferences:com.apple.preferences.internetaccounts or x-apple.systempreferences:com.apple.preferences.extensions?Share_Menu.

However this no longer works in El Capitan, instead opening just the normal System Preferences. Is there any way to achieve this functionality in El Capitan?

Note: Oddly enough the URL x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility does still work in El Capitan.

4

1 回答 1

0

我想出的一种方法是执行 AppleScript 来选择所需的窗格,但是这无法选择该窗格中的控件,例如“扩展”首选项窗格的“共享菜单”部分。

NSString *script = @"tell application \"System Preferences\"\n\tset the current pane to pane \"com.apple.preferences.extensions\"\n\tactivate\nend tell";
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script];
[appleScript executeAndReturnError:nil];
于 2015-11-05T21:23:25.083 回答