Renaming files with date

Found a good tutorial on using Automator to rename files using the creation date. I had several photos with duplicate filenames that I wanted to use in sequence by date.

Automator Quick Action, Run Shell Script with a Workflow receives current “files or folders” in “”

The script Shell: is bin/zsh and Pass Input: “as arguments”. The Quick Action is called RenameWithDate and is activated by right clicking on one or more filenames and choosing Quick Action in the popup menu, then selecting RenameWithDate:

for f in “$@”
filedate=$(date -r $(stat -f %B $f) +%Y-%m-%d);
mv $filepath/{“$filename”,”$filedate $filename”}

This is a link to the YouTube video: