用automator创建“快速操作”工作流实现网页截屏自动命名归类:先设“无输入”和“访达”触发,再用“拍摄屏幕快照”指定临时保存路径,最后通过applescript按年-月-日建子目录并以精确到秒的时间戳重命名移动文件。

用 Automator 实现网页截屏加自动命名归类,核心是把“截图→重命名→归档”三个动作串成一条静默执行的工作流。不依赖第三方工具,全程系统原生支持,关键在选对文稿类型、设好触发逻辑、用对变量命名。
选“快速操作”而非“服务”或“应用程序”
新建 Automator 文稿时,选“快速操作”最实用。它能直接从访达右键菜单调用,也支持绑定快捷键,适合网页截图这类需手动触发但又想省步骤的场景。注意设置顶部两个选项:
- “工作流接收”选“无输入”,避免误触时等待传参
- “在”下拉菜单选“访达”,确保右键菜单里能立刻看到你的操作项
截图动作要指定保存路径与临时名
从资源库拖入“拍摄屏幕快照”动作后,重点配置三项:
- Type 设为 “interactive”,保留人工选取区域的灵活性
- Option 选 “choose selection” 或 “capture entire screen”,按需切换
- Save to 必须指定一个固定文件夹(如 ~/Pictures/WebSnap/),文件名可暂填 “temp.png” —— 后续由重命名动作接管,不建议在这里写日期变量,容易冲突
用 AppleScript 实现动态命名与分类
系统自带的“重命名 Finder 项目”对时间戳支持有限,推荐插入一段轻量 AppleScript 替代:
- 拖入“运行 AppleScript”动作,粘贴如下代码(适配 macOS 14+):
on run {input, parameters}
set now to current date
set y to year of now as string
set m to text -2 thru -1 of ("00" & (month of now as number))
set d to text -2 thru -1 of ("00" & day of now)
set h to text -2 thru -1 of ("00" & hours of now)
set min to text -2 thru -1 of ("00" & minutes of now)
set sec to text -2 thru -1 of ("00" & seconds of now)
set baseName to y & "-" & m & "-" & d & "-" & h & "-" & min & "-" & sec
repeat with i from 1 to count of input
set f to item i of input
set ext to name extension of (info for f)
set newName to baseName & "." & ext
try
do shell script "mkdir -p ~/Pictures/WebSnap/" & quoted form of (y & "-" & m & "-" & d)
do shell script "mv " & quoted form of (POSIX path of f) & " ~/Pictures/WebSnap/" & quoted form of (y & "-" & m & "-" & d) & "/" & quoted form of newName
end try
end repeat
return input
end run
这段脚本会按年-月-日建子文件夹,并用精确到秒的时间戳命名,自动把截图移入对应日期目录。你只需提前在 ~/Pictures 下建好 WebSnap 主文件夹即可。
最后一步:绑定快捷键并测试
保存工作流后,在“键盘”系统设置 → “快捷键” → “快速操作”里,找到你刚保存的名字,勾选并分配组合键(如 ⌘+⌥+S)。测试时打开一个网页,按下快捷键,选中区域截图,几秒内就能在 ~/Pictures/WebSnap/2026-07-08/ 下看到带完整时间戳的 PNG 文件。











