I've been on a little bit of a journey trying to untangle myself from the creeping vines of Apple's walled garden. One of the tangliest bits has been getting my photos out of iCloud.
The software formerly known as iPhoto lets you drag your photos out of the liminal smart-cloud-space onto your local machine. But the file names are pretty useless to me. When dealing with photos and voice memos and the like, I strongly prefer having file names that start with a date time.
Luckily there's a CLI program called exiftool that makes it easy to batch rename files with the capture timestamp. You can install exiftool via Homebrew, like brew install exiftool.
Here's one example, renaming the file with a YYYY-MM-DDprefix, while retaining the original filename as a suffix:
exiftool -d %Y-%m-%d_%%f.%%e "-testname<CreateDate" /path/to/folder
The -testname part means the command will do a dry-run, outputting the renames that would happen without actually executing them. You can execute the renames by replacing -testname with -filename:
exiftool -d %Y-%m-%d_%%f.%%e "-filename<CreateDate" /path/to/folder
And here's another example, which renames the file without retaining any suffix, swapping in a magical auto-incremented number (%%-c):
exiftool '<CreateDate-filename' -d %Y%m%d_%H%M%S%%-c.%%le -r /path/to/folder
The exiftool documentation has a lot more detail, and this blog post on exiftool commands has some good explanation of common options. And to give credit where credit is due: I originally found exiftool through a blog post, Bulk Rename Photos to Date Taken with Exiftool.