I originally wrote this script to make a filing system for my photos as an alternative to iPhoto. But any kind of files can be organised by this script into year and month folders based on their modification dates.
I had a collection of 37,000 photos locked away in iPhoto when the database became corrupted. I tried rebuilding it but to no avail so I decided to ditch the program and organise my photos in an orderly folder hierarchy.
Having done only minimal editing of my photos, I decided to only save the original master versions. This script organises files according to their modification dates in folders like in the picture below.
The script will ask you for the source folder to move the files from (Photos/iPhoto/Masters in my case), and then the destination folder. It will search every single subdirectory inside the source folder and move every file to the new filing system. A report is created on the fly so you get an indication of the progress.
Note that if the source folder is on the same volume as your destination, the files will be MOVED, not duplicated. So you might want to make a backup if this is a problem.
This script can be used for any type of files that you would like to organise in this way, it’s not limited to images or the iPhoto folder.