林一二2023年06月13日 16:22
Ref: cnblogs-DeppWXQ
Keywords:
Keywords:
Automator 设置工作流:
- 添加 Folder Action,选择指定文件夹,添加 Run Shell Script
- 设置脚本,将新加入图片作为参数,遍历执行脚本
for f in "$@"
do
if [[ $(file --mime-type -b "$f") == image/*g ]]; then
/usr/local/bin/pngquant 64 --skip-if-larger --ext=.png --force "$f"
/usr/local/bin/zopflipng -y "$f" "$f"
fi
done