In summary the Rake file will:
- Move photo files, video files, GPS files into dated folders. Copy to backup hard drive.
- Import photos into Aperture
- Prepare backup DVDs for new photos
- Move burnt files to another folder
- Export tagged master files from Aperture
- Copy edited master files (eg for photoshop) to backup drive
- Prepare DVD for edited master files
- Create a JPG versions from Photoshop files with a watermark
- Show the current status of all your photos (for tasks above)
I have explained in depth what each of these tasks do but all you need to do to run the tasks is to type the command in a Terminal like this
rake task
Before you attempt any tasks in the Rake file I highly recommend you backup your Aperture library and photo collection. Even better is to create a test platform with a test photo folder and test Aperture Library to work on until you are confident it is doing what you expect.
You must first understand what workflow I have used. I had to change my own workflow so it would match an automated environment, but it was certainly well worth the effort. If your workflow does not match this one, you could modify the Rake file to match yours rather than changing your workflow.
1. System Requirements
- Aperture 3
- Photoshop (optional)
- The Rakefile. Download from here: http://code.google.com/p/automate-photo-workflow-aperture/
- Ruby. Mac computers come with Ruby installed. Try it now. Open a Terminal session, and type "ruby -v". If you get a "command unknown", you must install Ruby. Any latest stable version will be fine.
- Ruby gems: After Ruby is installed you will need to install the following gems if you havent already. Open a Terminal session and run the following commands (you may need to use sudo for these commands. If using rvm do not use sudo).
gem install rb-appscript
- exiftool. Reads metadata from all forms of photo files to find date/time stamp.
- gpsbabel. (Optional) If you have GPS files you like to organise.
2. Environment Settings
Copy this Rakefile and place in a test folder, for example ~/PicturesTest. The file must be named "Rakefile".
Open a Terminal sesssion and cd to your test folder:
cd PicturesTest
Now run "rake -T". This will list all the rake tasks in your Rakefile.
rolf$ rake -T (in /Users/rolf/PicturesTest) rake photos:copy_work_folder # Step 6: Copy master work folder files (eg PSDs) to backup ... rake photos:create_collection # Step 8: Create Website Collection from PSDs for given year... rake photos:export_working_masters[arg1,arg2] # Step 5: Export Tagged Master files from Aperture for given... rake photos:import_photos # Step 2: Import new photos into Aperture from /Volumes/Home... rake photos:move_burnt_files # Step 4: After all files have been burnt on a DVD, use this... rake photos:move_work_burnt_files # Step 9: After all work files have been burnt on a DVD, use... rake photos:order_new_photos # Step 1: Throw all photos/video into the /Users/rolf/Pictur... rake photos:prepare_dvd # Step 3: Create a Burn folder of earliest Photos (as symbol... rake photos:prepare_work_folder_dvd # Step 7: Prepare a DVD for files in masters work folder (PSDs) rake photos:status # Status of what needs to be done, eg DVDs burnt
Open the Rakefile in a text editor. Near the top of the file you will see constants which will need to change to suit your environment. You will understand these constants as we go through this blog.
# ======= Constants you must change to match your environment ==========
3. Order New Photos, Video, GPS files
This first task will order all your photo, video and GPS files into dated folders. Before we run this task I will explain what this task will do.
![]() | |
| Figure 1. Order New Photos Task |
This task requires that you have a hard drive plugged into your Mac where you will permanently store all your photos. Its not a good idea to store all your photos on your Mac only. This is represented as the orange "Photos" folder in Figure 1. This folder is defined as the PHOTO_MASTERS_FOLDER in the Rakefile. This folder must exist before running the Rakefile. For this blog I have created a temp folder called "Backup\Photos" for illustration only. This folder should exist on an external hard drive. All photo, video and GPS files will be copied into the hard drive and ordered into dated folders in the form yyyy/yyyymmdd, eg
Photos/2011/20110819
All the photo, video and GPS files in the New folder will be moved into the "Ordered" folder (PHOTO_ORDERED_FOLDER) with the same folder format used above.
Here is a screenshot of my folders before I run the rake task
![]() |
| Figure 2. My files I want to organise |
To run this task, type the following in your Terminal:
rake photos:order_new_photos
The results:
Moving photos and order from /Users/rolf/PicturesTest/New into date folders in /Users/rolf/PicturesTest/Ordered...
Warning: No writable tags found - /Users/rolf/PicturesTest/New/iPhone/IMG_0496.MOV
pfiles=
======== /Users/rolf/PicturesTest/New/DSC_6940.NEF
======== /Users/rolf/PicturesTest/New/DSC_6941.NEF
======== /Users/rolf/PicturesTest/New/DSC_6942.NEF
======== /Users/rolf/PicturesTest/New/iPhone/IMG_0495.JPG
2 directories scanned
2 directories created
4 image files updated
======== /Users/rolf/PicturesTest/New/iPhone/IMG_0496.MOV
Nothing changed in /Users/rolf/PicturesTest/New/iPhone/IMG_0496.MOV
2 directories scanned
0 image files updated
1 image files unchanged
======== /Users/rolf/PicturesTest/New/iPhone/IMG_0496.MOV
2 directories scanned
1 image files updated
Copying 8 files to hard drive...
/Users/rolf/PicturesTest/Ordered/2011
/Users/rolf/PicturesTest/Ordered/2011/20110514
/Users/rolf/PicturesTest/Ordered/2011/20110514/IMG_0495.JPG
>>> Created folder /Users/rolf/PicturesTest/Backup/Photos/2011/20110514
/Users/rolf/PicturesTest/Ordered/2011/20110514/IMG_0496.MOV
/Users/rolf/PicturesTest/Ordered/2011/20110814
/Users/rolf/PicturesTest/Ordered/2011/20110814/DSC_6940.NEF
>>> Created folder /Users/rolf/PicturesTest/Backup/Photos/2011/20110814
/Users/rolf/PicturesTest/Ordered/2011/20110814/DSC_6941.NEF
/Users/rolf/PicturesTest/Ordered/2011/20110814/DSC_6942.NEF
GPX File: /Users/rolf/PicturesTest/New/20110815 Brown Hill Creek.GPX
>>> Created folder /Users/rolf/PicturesTest/Backup/Photos/2011/20110612
5 files copied to Masters Drive. 0 files already exist in Masters Drive.
You will see all files moved to the Ordered folder as seen in Figure 3.
![]() |
| Figure 3. Ordered folder after running task |
And copied to your Hard drive (temp Backup folder used for testing) as seen in Figure 4.
![]() |
| Figure 4. Photo Hard Drive folder after running task |
The important part of the results is the comment at the end. Was there an error or not. Also the last line tells you how many files were copied to the Masters Drive (your photo hard drive), and how many photos were not copied. So this process will prevent duplicates. If I had copied the same photo again in my New folder and run the rake script, the script will find a match already in the Photo hard drive and will NOT copy or move the file from the New folder. Lets try this now.
I copied the IMG_0495.JPG file in my New folder again. Now when I run the task again I get this result:
Moving photos and order from /Users/rolf/PicturesTest/New into date folders in /Users/rolf/PicturesTest/Ordered... Error: '/Users/rolf/PicturesTest/Ordered/2011/20110514/IMG_0495.JPG' already exists - /Users/rolf/PicturesTest/New/IMG_0495.JPG ... 0 files copied to Masters Drive. 6 files already exist in Masters Drive.
The file stays in the New folder. It is up to you to delete or move this file. This task does NOT delete any file or folder. Be careful deleting. Some files do not contain any metadata like scanned images. These files will not be moved or copied. You must manually move/copy the files. For scanned images I have created a "Scanned" folder where I copy/move the scanned photos. So after running this task look in the New Folder to see if all files were moved.
For scanned images you will see this message from the results:
Warning: No writable tags found - /Users/rolf/PicturesTest/New/scan0001.jpg
Click the Next link below for Part 2 of the blog.
Next



