iPhoto - Export Selected Original Images to a folder

Hey all, I was wondering if anyone would have the following work flow or some parts of it:

A. Export Selected Original Images to a folder.
1. Set Format to Original
2. Set Size to Full-size Images
3. Set Name to Use File name
4. Enable Use extension
5. Export
6. Create a folder called originials on ~/Desktop/originals
7. Export to a particular folder on the desktop ~/Desktop/originals/

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.

good idea.
It seems to work when images have been copied to the library folder when importing.

I am looking for a possibility to find the original path when images haven’t been copied.
The modified files are now in “modified” but how can I find the original without using
GUI scripting.

Any suggestions?

In iPhoto 8,
It looks like an alias to the original is created in the Original’s folder if you do not have copy to iPhoto on import.
I do not have iPhoto 6 any more so can not test it in it

EDIT**
heres a quick edit of Craig’s script

set biglist to {}
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 my SwapOriginal4Mod(b's image path)
		else
			set end of sel_list to b's image path
		end if
		
	end repeat
end tell
repeat with i from 1 to number of items in sel_list
	set this_item to item i of sel_list
	set this_item to POSIX file this_item
	tell application "Finder"
		
		set this_type to kind of this_item
		log this_type
		if this_type is "Alias" then
			set this_item to original item of alias file this_item as alias
		else
			set this_item to this_item  as alias
		end if
		copy this_item to end of biglist
	end tell
end repeat
biglist

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