1 Reply Latest reply: Mar 5, 2013 5:13 PM by Frank Caggiano
Bruce Michel Level 1 (30 points)

I am scanning a lot of quite old film for which I can only guess at the date taken.  Aperture import puts the timestamp of the scan in the date field.   I have created a custom field "Date Shot".  I will manually enter the date as yyyy-mm-dd (perhaps only year).  I would like to be able to sort all of my photos by Date Shot.  This means copying and reformatting the timestamp for all of my digital photos (in certain projects) into Date Shot.


It looks quite possible using AppleScript.  I have done lots of programming, but know nothing about that language.  Just quickly reviewed the Aperture 3 AppleScript document.


I would appreciate any ideas or code to use as a start for this effort.  I assume one can pick out the date components and reformat using printf-type commands.

  • Frank Caggiano Level 7 (25,715 points)

    I've done some Aperture scripting. Some things work nice some things don't, Aperture is not the best example for first time application scripting. 


    There are many good resources on the web


    These two from Apple

    AppleScript Overview

    AppleScript Language Guide


    Two other good sites




    Here is some code that takes a selection of images in Aperture, gets the EXIF date takes the time component from that  and make a custom tag field name Capture Time and puts the time in it.


    display dialog "Aperture will Start." & return & return & "Select image(s), press Continue when ready" buttons {"Continue", "Stop"} default button 1
    set the user_choice to the button returned of the result
    if the user_choice is "Stop" then
      tellme to quit
    end if
    tell application "Aperture"
              set imageSel to (get selection)
              if imageSel is {} then
                        error "Please select an image."
                        repeat with i from 1 to count of imageSel
                                  tell item i of imageSel
                                            set imageDate to value of EXIF tag "ImageDate"
                                            set s to time string of imageDate
                                             make new custom tag with properties {name:"Capture Time", value:s}
                                  end tell
                        end repeat
              end if
    end tell


    Anyway this should give you a starting point. Good luck.