Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Sort iPhoto album images by forward date Apps
It bugs me that when you sort photos by date in iPhoto, they are arranged so that the latest photo is first. Well, when I'm watching a slideshow of a day out or a holiday, I kind of want to see the photos in chronological order, call me fussy. This may well have been fixed in iPhoto '04 or since, but I'm still on version 2.

I don't want to change the date or time of the photos, since I think the correct date is rather important sometimes, and manually re-arranging them into the correct order takes too long.

So last night, I finally whipped up this AppleScript which first sorts the photos into date order, then flicks over to manual ordering, and re-imports all the photos in the reverse order. It takes a while to run on my machine, but then, it is nearly four years old now and iPhoto 2 was never a speed demon anyway.

It might also be possible to speed it up by creating a new album with the correct ordering and deleting the old one, but I leave this as an exercise to the reader. Be aware that the script requires UI Scripting to be enabled (Universal Access -> Enable Access for Assistive Devices). To sort an album, just open (select) the album at the organise tab, and run the script either from AppleScript directly, or save it in your user's ~/Library/Scripts folder.

[robg adds: Read on for my take on photo sorting in iPhoto, and how I modifed the script to work with the latest version of iPhoto...

Unfortuantely, sorting in the latest iPhoto is still somewhat odd, because there's only a global-level "show newest photos as the top" setting. In my case, I view by film roll and want the newest photos at the top. But when sorted in that manner, then the images within each album are also sorted "backwards." Thankfully, Lee Noble's script can be easily modified to work with the latest iPhoto -- which I have done in the linked version above (assuming most people here are using the latest version).

I have, however, commented the source to indicate the required changes to make it functional with older versions of iPhoto. Basically, at some version in the past, iPhoto changed the current View -> Sort Photos menu item into View -> Arrange Photos. If your version has the Arrange Photos menu item, you'll have to edit the script as noted to make it work for you.

I saved the finished script in an iPhoto folder in my user's Library -> Scripts folder, and just pick it from the Scripts menu when I want to run it. It's no speed demon (about one second per image in the selected album; revised faster scripts welcomed!), but it works, and works well. As with anything potentially destructive, having a current backup is always a good idea.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[16,031 views]  

Sort iPhoto album images by forward date | 4 comments | Create New Account
Click here to return to the 'Sort iPhoto album images by forward date' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sort iPhoto album images by forward date
Authored by: leenoble_uk on Nov 21, '05 08:09:56AM
You could have added if/thens or a try statement on the menu to be clicked

try
tell menu item "Sort Photos"
tell menu "Sort Photos"
click menu item "by Date"
end tell
end tell
end try
try
tell menu item "Arrange Photos"
tell menu "Arrange Photos"
click menu item "by Date"
end tell
end tell
end try
and there's probably a way to test for the version number of iPhoto and do it that way too.

---
Brought to you by S C Johnson, a family multinational conglomerate.

[ Reply to This | # ]

Sort iPhoto album images by forward date
Authored by: SlewSys on Nov 21, '05 06:02:27PM
Assuming that your camera names the images sequentially, try View -> Arrange/Sort Photos -> by Title. If merging images from several cameras, maybe renaming images according to their EXIF creation date would be warranted. For example, running the following Perl script would rename all JPEGs in the current directory.

#!/usr/bin/perl

use Image::ExifTool;

$exif = new Image::ExifTool;
$exif->Options(Group0 => ['EXIF']);

$exif_tag = "CreateDate";

foreach (<*.[Jj][Pp][Gg] *.[Jj][Pp][Ee][Gg]>) {
        $image = $exif->ImageInfo($_);
        ($image_date = $image->{$exif_tag}) =~ y/: /.-/;
        if (! $image_date) {
                printf STDERR "$_: No EXIF: Con't rename.n";
                next;
        }
        $seen{$image_date}++;
        $new_name = $image_date . "-" . $seen{$image_date} . ".jpg";
        printf STDERR "$_ => $new_namen";
        rename $_, $new_name;
}
# End of Script
The Perl module Image::ExifTool can be installed via the terminal command:
 perl -MCPAN -e install Image::ExifTool 


[ Reply to This | # ]
Sort iPhoto album images by forward date
Authored by: leenoble_uk on Nov 22, '05 02:40:00AM

My camera does name the files sequentially but iPhoto still orders then in reverse when arranged by title. I don't understand its attitude.

If I used that method and then changed the titles of any of the photographs for use in an album or publishing on dotMac then arranging by title wouldn't help.

There really should be an option to arrange, in all four ways, ascending and descending. Just an arrow to flip the list upside down would do the job.

---
Brought to you by S C Johnson, a family multinational conglomerate.



[ Reply to This | # ]
Sort iPhoto album images by forward date
Authored by: CubaMark on Nov 22, '05 06:53:56AM

It's easier than this - no applescript required.

Just select the photos (Select All)
- Go to Photos-->Batch Change
- Select Date
- default is 'add one second'
- OK

Photos are now sorted in chronological order.

:)
M



[ Reply to This | # ]