This is much easier than in extracting the date in Aperture 2.x, but still perhaps more difficult than it should be…
on apertureDate(apertureImage)
tell application "Aperture"
set a to value of EXIF tag "CaptureYear" of apertureImage
set b to value of EXIF tag "CaptureMonthOfYear" of apertureImage
set c to value of EXIF tag "CaptureDayOfMonth" of apertureImage
set d to value of EXIF tag "CaptureHourOfDay" of apertureImage
set e to value of EXIF tag "CaptureMinuteOfHour" of apertureImage
set f to value of EXIF tag "CaptureSecondOfMinute" of apertureImage
{a, b, c, d, e, f}

set imageDate to current date

set year of imageDate to a
set month of imageDate to b
set day of imageDate to c
set hours of imageDate to d
set minutes of imageDate to e
set seconds of imageDate to f
end tell
return imageDate
end apertureDate

then


tell application "Aperture"
set thePhoto to item 1 of selection
end tell

set photoDateAS to my apertureDate(thePhoto)

Leave a Reply...