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

如何修改Capture One脚本字典中类的属性?AppleScript操作报错求解

问题原因与解决方案

你遇到的两个报错是操作Capture One AppleScript接口的常见问题,核心原因有3个:

  1. 属性值类型不匹配
    Capture One的存储路径属性不接受纯字符串路径,需要传入POSIX file或alias类型的文件对象,直接传"/tmp"字符串会直接触发写入报错。
  2. 作用域依赖缺失
    next capture options对象只有在你已经打开一个有效拍摄会话(Capture Session)的情况下才会存在,没有打开会话时调用该对象的读写操作都会返回-1728错误。
  3. 系统权限限制
    最新版macOS的隐私保护机制会限制应用的磁盘读写权限,如果没有给Capture One开启完全磁盘访问权限,也会触发-10006写入被拒错误。

可运行示例代码

先打开Capture One并新建/打开一个拍摄会话,再运行以下脚本:

tell application "Capture One 21"
    activate
    -- 将字符串路径转换为AppleScript识别的文件对象
    set targetPath to POSIX file "/tmp" as alias
    -- 部分版本属性名为capture location,如运行报错可替换属性名测试
    set capture location of next capture options to targetPath
end tell

排查步骤

如果修改后仍有报错,可按以下顺序确认:

  • 运行以下脚本确认对象是否存在:
tell application "Capture One 21"
    return exists next capture options
end tell

如果返回false,说明会话未正确打开,先完成会话初始化操作再执行修改。

  • 打开macOS「系统设置」-「隐私与安全性」-「完全磁盘访问」,确认Capture One的权限开关已开启。
  • 打开对应版本的Capture One AppleScript字典,确认next capture options类下的路径属性名,部分版本属性为image location,部分为capture location,以字典标注为准。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.29 22:15:00