Random Filenames for Digital Photo Frame Images
Share
Many of the digital photo frames on the market still don’t have the ability to shuffle images and display them in random order. A couple people I know have frames and want to mix up the photo stream a little. The first time I ran into this issue I used a Windows utility called renamer to assign random names to the image files. But what about a pure Mac solution?
There is one, and you don’t need anything other than OS X to get it done. Skip to the screencast if you prefer - otherwise here’s what you do:
Place the files to be renamed in one folder. It’s best to have them all in one folder without subfolders. If you have images scattered inside subdirectories you’ll have to make some adjustments to these instructions. USE A COPY OF YOUR ORIGINAL IMAGE FILES, there’s no reason not to.
Open the Terminal from your Utilities folder in Applications. Type cd followed by a space. Then drag the folder containing the files from Finder to the Terminal window. Hit return. The Terminal prompt should update to indicate you’re now in the directory containing the images. This folder should NOT BE THE SAME AS THE ONE YOUR ORIGINALS RESIDE IN. Sorry for that, but it’s important.
Finally, type the following command in the Terminal:
for i in *.jpg; do mv $i $RANDOM.jpg; done
The command is case-sensitive. If your images have names ending .JPG you’ll need to adjust the *.jpg part of the command above to use a capital JPG.
Hit return and your image files are renamed using random numbers. Copy them to the digital photo frame and your images should cycle randomly. Thanks to this thread at Mac Rumors Forums.
I’ve included a screencast for those not familiar with Terminal. Be careful in the Terminal. You can delete files accidentally and they won’t be in your Trash ! See this warning for more information.
Screencast | Permalink
19. January 2010 at 7:07 pm :
It might be advisable to use “mv -n” to avoid overwriting existing files.
27. January 2010 at 3:02 am :
they cease to be random as soon as they enters the photo frame… just a different order, but still an order.
28. January 2010 at 4:56 pm :
@Mike -
This is still better than nothing. Some things can only be addressed by the frame makers…
26. February 2010 at 2:05 pm :
Some suggestions on improving the command as I posted it:
http://www.tuaw.com/2010/02/25/terminal-tips-generate-random-filenames-for-digital-photo-frame/
31. May 2010 at 4:54 am :
Seems a shame to have to rename your images just to get randomness out of this scenario. I would be more inclined to keep the images as they stand and find a way to move batches in and out of where they need to be in a random order.
Don’t pretty much all image display devices have some “random” mode for playback?
31. May 2010 at 11:48 pm :
I’ve only used a couple of these frames, but none of them had a random / shuffle command.
And I wouldn’t rename the copies that I keep and store, I would run this command against a copy created for this purpose. From the post:
” USE A COPY OF YOUR ORIGINAL IMAGE FILES, there’s no reason not to.”