Hey all,
Does anyone have a script or know of a script that can do
- Search through iphoto library/database
- find images/movies that were imported on a specified date
- Add those images/movies in album named “search”
thanks
Hey all,
Does anyone have a script or know of a script that can do
thanks
Imported date is not a parameter of images in iPhoto that is available via AS directly, neither does the image file itself contain that information. From my playing around with it, it seems that by accessing the metadata for the thumbnail image of a photo and selecting the kMDItemContentCreationDate, you can get that photo’s imported date:
set display_import_dates to {}
tell application "iPhoto" to set all_thumb_paths to thumbnail path of every photo of album "display"
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to " = "
repeat with thumb_path in all_thumb_paths
set end of display_import_dates to text item 2 of (do shell script "mdls -name kMDItemContentCreationDate " & quoted form of thumb_path)
end repeat
set AppleScript's text item delimiters to astid
-->{"2007-11-01 23:14:35 -0700", "2007-11-01 23:09:35 -0700", "2007-11-01 23:12:41 -0700", "2007-11-01 23:18:08 -0700", "2007-11-01 23:18:09 -0700", "2008-04-07 21:43:09 -0700", "2008-04-07 21:43:11 -0700", "2008-04-07 21:43:02 -0700", "2008-04-07 21:42:59 -0700", "2008-04-07 21:43:06 -0700"}
Of course, now you have a list of UTC date strings that will need to be massaged into AS date objects for your analysis. Plus, this particular script does not retain which photos are associated with which dates, so it is not terribly useful in its present format.
I apologize for providing an incomplete solution, but hopefully this will get you started, or someone else will have a superior method.