Modify dates in iPhoto

by brian d foy

Before my WWDC presentation, I met Joe Maller who has an AppleScript to update the dates and times of photos in iPhoto. This is very cool, since I had tried (and failed) at a Perl solution.

The problem is that iPhoto's dictionary claims the field is read-only. However, a user can change it in the Info pane of iPhoto. Joe simply scripted this through GUI Scripting.

8 Comments

pudge
2005-06-09 20:10:06
UI scripting
UI scripting is a big pain. I do it sometimes, but it's a pain (even in perl), and I avoid it when I can. I use one to log into chat rooms in iChat.
Zeno
2005-06-10 02:21:49
EXIF or not EXIF?
does this actually modies the time/date in the EXIF header of each images? Or it only modifies the iPhoto database?
derrick
2005-06-10 07:57:45
RE: EXIF or not EXIF?
Not EXIF. That's what's so cool. Just modifies the date in the iPhoto field. And you can easily change it back,
Zeno
2005-06-13 07:34:00
RE: EXIF or not EXIF?
That's actually NOT cool ;-) I really don't like the fact that iPhoto doesn't use (or give the option to use) the standard headers (EXIF and/or IPTC) to store some of its metadata (date/time, keywords, etc)...it's a pain for exporting because you'll loose those info...
joemaller
2005-06-13 11:52:37
International version coming soon
Thanks for the plug, it was great to get to meet you in person last week.


I've been cleaning up the date-setting subroutines so they work with international dates and the new versions will be online soon. They're also faster, though still definitely constrained by the combined limitations of iPhoto and UI Scripting.


I'm also working on Automator actions and possibly an AppleScript Studio app.

joemaller
2005-06-13 12:05:40
RE: EXIF or not EXIF?
I was looking for a solution to a problem specific to iPhoto. Originally I only wanted to fix incorrect movie dates, everything else just happened because I had the foundation built already. This solution doesn't do anything to the original files. Date resetting is accomplished by gracelessly scraping the original JPEG headers, but all data modification is restricted to the iPhoto Library.


If you can point me to a good EXIF and/or IPTC toolset which works from a vanilla OSX command line, I can probably implement that too. IPTC data insertion/updating has already been requested a few times, but I don't know enough about the formats or binary data to be comfortable monkeying around with embedded information in original files.


Another feature/problem with iPhoto is that a high percentage of stored photos have two sources, the unmodified original and the modified (active) file. EXIF data is moved forward to the new images, but doesn't consider any of the metadata from the iPhoto Library.

Zeno
2005-06-15 06:37:29
RE: EXIF or not EXIF?
quote: "If you can point me to a good EXIF and/or IPTC toolset which works from a vanilla OSX command line..."


of course.
I use jhead (pre-built osx binary available from http://www.sentex.net/~mwandel/jhead/) that I call from an AppleScript (and recently from an Automator workflow). It works great. As an example, I use the command "jhead -exonly -nf%Y%m%d-%H%M%S myphoto.jpg" to rename the image according to its exif date (in this case I would get something like "20031219-000027.jpg")...I also use ImageMagick (imagemagick.org) in the same way....with those tools you can really play with the exif and iptc headers (modifying/adding/removing lots of things in there)....It would be just damn cool if iPhoto would have those capabilities "built-it"...

Zeno
2005-06-15 06:38:43
RE: EXIF or not EXIF?
sorry: "built-in" ;-)