You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

macOS 13 Ventura中AppleScript无法自动跳转至系统设置隐私面板求助

macOS 13 Ventura下自动跳转隐私面板AppleScript修复方案

问题背景

macOS 13(Ventura)中,旧版系统可正常运行的自动跳转至系统设置隐私面板的AppleScript失效,用户尝试多种修改写法后仍无法解决问题。

用户原旧版可用脚本

tell application "System Settings"
    -- 获取安全与隐私偏好设置面板的引用
    set securityPane to pane id "com.apple.preference.security"
    
    -- 导航至隐私选项卡下的辅助功能板块
    --(锚点名称无特定层级含义)
    tell securityPane to reveal anchor "Privacy_Accessibility"
    
    -- 打开偏好设置窗口并置于最前端
    activate
end tell

用户尝试过的无效脚本

  1. 写法一:
tell application "System Settings"
    tell pane id "com.apple.preference.security?Privacy_Accessibility" to anchor
    activate
end tell
  1. 写法二(与原脚本一致,Ventura下无效):
tell application "System Settings"
    -- 获取安全与隐私偏好设置面板的引用
    set securityPane to pane id "com.apple.preference.security"
    
    -- 导航至隐私选项卡下的辅助功能板块
    --(锚点名称无特定层级含义)
    tell securityPane to reveal anchor "Privacy_Accessibility"
    
    -- 打开偏好设置窗口并置于最前端
    activate
end tell

修复方案

macOS Ventura的System Settings应用架构发生调整,原锚点引用逻辑不再适配,需调整脚本步骤,确保先激活应用并加载目标面板后再跳转锚点:

tell application "System Settings"
    activate
    -- 先加载安全设置面板
    reveal pane id "com.apple.preference.security"
    -- 跳转至辅助功能隐私板块
    reveal anchor "Privacy_Accessibility" of pane id "com.apple.preference.security"
end tell

优化补充

若面板加载存在延迟导致跳转失效,可添加短暂等待确保面板完全加载:

tell application "System Settings"
    activate
    reveal pane id "com.apple.preference.security"
    -- 等待1秒确保面板加载完成
    delay 1
    reveal anchor "Privacy_Accessibility" of pane id "com.apple.preference.security"
end tell

内容的提问来源于stack exchange,提问作者Bhautik B

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 23:20:39