hey slash:
You may get by with my ScriptBuilders script, One Hour iPhoto. The tricky thing about iPhoto is how it stores original images versus the images you have done any kind of modifications with. Once a photo has been modified in any way, iPhoto retains the original, but the image path now shows the modified path:
tell application "iPhoto"
set a to selection
set sel_list to {}
repeat with b in a
set end of sel_list to {b's name, b's image path}
end repeat
end tell
-->{{"PICT0236.JPG", "/Users/casdvm/Pictures/iPhoto Library/Originals/2006/Roll 76/PICT0236.JPG"}, {"PICT0237.JPG", "/Users/casdvm/Pictures/iPhoto Library/Modified/2006/Roll 76/PICT0237.JPG"}}
With the advent of iPhoto 6, you can usually ‘build’ the image path to the original image like this:
tell application "iPhoto"
set a to selection
set sel_list to {}
repeat with b in a
if b's image path contains "Modified" then
set end of sel_list to {b's name, my SwapOriginal4Mod(b's image path)}
else
set end of sel_list to {b's name, b's image path}
end if
end repeat
end tell
on SwapOriginal4Mod(imp)
set mod_Off to offset of "Modified" in imp
set new_Path to (characters 1 thru (mod_Off - 1) of imp & "Originals" & characters (mod_Off + 8) thru -1 of imp) as string
return new_Path
end SwapOriginal4Mod
-->{{"PICT0236.JPG", "/Users/casdvm/Pictures/iPhoto Library/Originals/2006/Roll 76/PICT0236.JPG"}, {"PICT0237.JPG", "/Users/casdvm/Pictures/iPhoto Library/Originals/2006/Roll 76/PICT0237.JPG"}}
I used the same selection in both scripts. The only difference is that the second script changed the Modified to Originals, which should work, but I admit that I have never tested it.
The only other thing to worry about (which is why I wrote One Hour iPhoto in the first place), is that every once in a while, you will get two files with the same name, since the images were created on different dates, and the camera card had been emptied in between. So, you get PICT0333.jpg in two different folders.
Remember that these image paths are UNIX, not Mac, so you will either need to convert them using the POSIX file command, or copy them via the shell. I recommend that you get into my One Hour iPhoto code and use links. They are way better than aliases, and take up zero hard drive space. When working with digital photos, it’s the only way to keep from burning up memory.
Hope this helps you out somewhat.