I created this to prevent storing duplicate images I save as I browse the internet. While syncing my folders of memes and Monika across multiple computers I discovered that I had saved the same image multiple times.
Just run the script with the path to a file or a directory of files to rename.
I combined this script with the following Automator scripts to move any images I download into a separate folder, then automatically rename anything that gets put into that folder. This is (IMO) the best setup because not only are downloaded images handled, but you can also just "Save as" images into your separate folder for the same result. If you don't manually sort your images, you could set renamed files to be automatically moved somewhere after they get renamed.