【问题标题】:Open Display preferences programmatically?以编程方式打开显示首选项?
【发布时间】:2019-10-23 19:59:15
【问题描述】:

如何以编程方式打开显示首选项,如下所示,用于网络首选项

[[ NSTask
      launchedTaskWithLaunchPath: @"/usr/bin/open"
      arguments: [ NSArray
   arrayWithObject: [ @"/System/Library/PreferencePanes/Network.prefPane/" stringByExpandingTildeInPath ]]
  ] waitUntilExit ];

【问题讨论】:

    标签: objective-c macos cocoa


    【解决方案1】:

    您可以使用它找到您想要打开的任何 Pref 窗格

    /System/Library/PreferencePanes/
    

    显示偏好

     [[ NSTask
          launchedTaskWithLaunchPath: @"/usr/bin/open"
          arguments: [ NSArray
                      arrayWithObject: [ @"/System/Library/PreferencePanes/Displays.prefPane/" stringByExpandingTildeInPath ]]
          ] waitUntilExit ];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-13
      • 2018-01-15
      • 1970-01-01
      • 2011-03-09
      • 1970-01-01
      • 2012-05-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多