4

Is there an app on OS X that can sort through all your photos within a folder and organize them into folders and name each folder the date it was taken.

1

Here's a bash script that sorts files into year/month/day/ directory paths.

#!/bin/bash
dir=/path/to/directory
find "$dir" -maxdepth 1 -type f | while IFS= read -r file; do
  year=$(stat -f "%Sm" -t "%y" $file)
  month=$(stat -f "%Sm" -t "%m" $file)
  day=$(stat -f "%Sm" -t "%d" $file)
  [[ ! -d "$dir/$year/$month/$day" ]] && mkdir -p "$dir/$year/$month/$day"; 
  mv "$file" "$dir/$year/$month/$day"
done

Untested, have backups, etc

Save the script as something.sh, change the second line of the script to the path that you want to sort the contents of, then run chmod u+x /path/to/file.sh && /path/to/file.sh. However, if you are unfamiliar with shell scripts I wouldn't recommend this hacked-together, untested script that I wrote late at night be the very first script you run!

5
  • How would I go about running that script?
    – 1Rabbit
    Aug 30 '14 at 20:28
  • Save the script as something.sh, change the second line of the script to the path that you want to sort the contents of, then run chmod u+x /path/to/file.sh && /path/to/file.sh. However, if you are unfamiliar with shell scripts I wouldn't recommend this hacked-together, untested script that I wrote late at night be the very first script you run :)
    – grg
    Aug 30 '14 at 21:08
  • 1
    This is using the filesystem timestamp - depending on the files, might be worth checking the EXIF data (if it's available) using something like ExifTool. You could have the script check Exif and use that, then fall back to the filesystem data, or log differences.
    – Alex
    Aug 31 '14 at 1:53
  • @Alex This was never meant to be a finished, canonical do-all script. I'm against writing entire scripts for answers—I just happened to have this script already written and the answer wasn't asking for a script but an app.
    – grg
    Aug 31 '14 at 8:58
  • True, I was just looking for an app.
    – 1Rabbit
    Aug 31 '14 at 13:57
0

Aperture can import images and have them sorted by date but you end up with projects inside Aperture (the project names are the dates the photos were taken). Make sure the Preferences » Import settings are set to split import into "One Project Per Day". If you don't want to keep them in Aperture, you can easily export them back out into folders.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .