Automator:更改所选查找器项目的修改日期

Automator: Change modification date of selected finder items

我想创建一个自动化服务来将所选查找器文件的修改日期更改为当前日期。我从哪里开始?

创建一个 Automator 服务:

在“Finder”中将弹出窗口设置为“文件或文件夹

添加“运行 Shell脚本”操作,将弹出窗口设置为“/bin/bash”和“作为参数”。

将此脚本放入动作中:

d=$(date  "+%Y%m%d%H%M.%S") ## the formatted current date
touch -t $d "$@" ## change the file's modification date

保存工作流程,仅此而已。