I modified the "Recursive Image File Processing Droplet" example provided from Apple in AppleScript Editor to rename any dropped file and move it to a custom folder. It worked seemingly flawlessly when I dropped images directly from iPhoto. Unfortunately I noticed now that the files where moved out of the iPhoto Library. So now the iPhoto Library is corrupted and iPhoto show the files I processe.
First of all when I dropped the files on my droplet it showed reassuringly the green "plus" sign, so I thought it was actually providing the droplet a copy of the file. Isn't this a sign of bad user interface?
Now, I'd like to know how to deal with the corrupted iPhoto Library and the missing pictures. So my real question is how to recover a corrupted iPhoto Library in the most painless way, when all happened is that some files where renamed and moved away. I wrote all the story as a warning for people who may do the same thing.
My system is OS X 10.7.4 and I am using iPhoto '09 8.1.2.