Date 自动机:更改所选查找程序项的修改日期

Date 自动机:更改所选查找程序项的修改日期,date,automator,finder,Date,Automator,Finder,我想创建一个automator服务,将所选查找程序文件的修改日期更改为当前日期。从哪里开始?创建自动机服务: 在“查找器”中将弹出窗口设置为“文件或文件夹” 添加“运行Shell脚本”操作,将弹出窗口设置为“/bin/bash”和“作为参数” 将此脚本置于操作中: d=$(date "+%Y%m%d%H%M.%S") ## the formatted current date touch -t $d "$@" ## change the file's modification date 保存

我想创建一个automator服务,将所选查找程序文件的修改日期更改为当前日期。从哪里开始?

创建自动机服务:

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

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

将此脚本置于操作中:

d=$(date  "+%Y%m%d%H%M.%S") ## the formatted current date
touch -t $d "$@" ## change the file's modification date
保存工作流,仅此而已