适配多版本macOS的隐私与安全面板Profiles页打开命令咨询
兼容macOS 13.x各版本的命令方案
针对不同macOS 13版本打开配置文件页面的差异问题,提供两个兼容方案:
方案一:使用系统偏好设置URL Scheme(推荐)
直接通过带参数的URL指定目标页面,在13.1和13.6.3版本均可直接打开Profiles页面:
open "x-apple.systempreferences:com.apple.preference.security?Profiles"
方案二:使用AppleScript强制定位
如果URL方案失效,可通过AppleScript显式导航到目标页面,兼容性更强:
osascript -e 'tell application "System Preferences" activate set current pane to pane id "com.apple.preference.security" reveal anchor "Profiles" of pane id "com.apple.preference.security" end tell'
内容的提问来源于stack exchange,提问作者Kurt
相关产品推荐
相关产品推荐

