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

求助:基于QuickTime Player 7的Automator droplet与AppleScript参考文件生成

解决Automator Droplet + QuickTime Player 7生成_ref.mov参考文件的问题

我明白你想要的是一个能拖放视频文件就自动生成带_ref.mov后缀参考文件的Automator droplet,而且要利用QuickTime Player 7默认保存为参考文件的特性——确实这个默认行为省了不少事,不用纠结找不到的save reference file方法。下面是一套完整的解决方案,应该能满足你的需求:

第一步:创建Automator Droplet

  • 打开Automator,选择应用程序模板(也就是Droplet)
  • 在左侧动作库中找到运行AppleScript动作,拖到右侧工作流区域
  • 把默认的AppleScript代码替换成下面的脚本

第二步:完整AppleScript代码

on run {input, parameters}
    -- 遍历所有拖入的文件
    repeat with aFile in input
        -- 获取文件的POSIX路径和基本信息
        set filePOSIX to POSIX path of aFile
        set fileInfo to info for aFile
        set fileName to name of fileInfo
        set fileExtension to name extension of fileInfo
        set fileBaseName to text 1 thru ((length of fileName) - (length of fileExtension) - 1) of fileName
        
        -- 构造新的参考文件名:原文件名 + _ref.mov
        set refFileName to fileBaseName & "_ref.mov"
        set refFilePOSIX to (POSIX path of (container of aFile as alias)) & refFileName
        
        -- 启动QuickTime Player 7并打开目标文件
        tell application "QuickTime Player 7"
            activate
            set theMovie to open filePOSIX
            -- 利用默认行为保存为参考文件
            save theMovie in file refFilePOSIX
            close theMovie
        end tell
    end repeat
    return input
end run

关键细节解释

  • 多文件批量处理:脚本通过repeat循环遍历所有拖入的文件,不管你拖一个还是多个视频,都能逐个生成对应的参考文件
  • 精准文件名拼接:自动提取原文件的基础名称(去掉原后缀),拼接上_ref.mov,确保新文件和原文件在同一目录下,不会搞混路径
  • 利用默认保存特性:QuickTime Player 7的默认保存格式就是参考文件,所以直接用标准的save命令就行,完全不需要额外的属性设置——这正好解决了你找不到相关描述符文档的问题
  • 自动清理窗口:保存完成后自动关闭当前视频窗口,避免QuickTime Player打开一堆窗口占用资源

如果之前你找到的脚本不能完全满足需求,大概率是没处理好多文件逻辑或者文件名拼接的细节,这个脚本应该能覆盖你的所有需求。保存Automator应用后,直接拖放视频文件到这个应用图标上,就能自动生成你需要的参考文件了。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 06:50:53