我需要在我的应用程序中打开 network-prefpane。这适用于
[[NSWorkspace sharedWorkspace] openFile:@"/Path/To/PrefPane"];
但是如何直接打开“高级”下“网络首选项”中的“代理设置”?
您可以在“高级->代理”下的 Safari 设置中看到这一点
谢谢
最佳答案
我发现的最简单、最干净的方法是使用 Applescript。
NSAppleScript *a = [[NSAppleScript alloc] initWithSource:@"tell application \"System Preferences\"\nactivate\nset current pane to pane \"com.apple.preference.universalaccess\"\nend tell"];
[a executeAndReturnError:nil];
[a release];
将 com.apple.preference.universalaccess 替换为 Pane 的名称。 Here is a full list of preference pane names .
关于objective-c - 以编程方式打开带有部分的 PrefPane,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2042066/