This is a newbie attempt at discovering the creation date of photos. Please note that it is the photo creation date that I want, not the file creation date, so I am looking at the EXIF metadata in the image files.
This test script works:
set theFile to choose file
tell application "Image Events"
set theOpenedFile to open theFile
tell theOpenedFile
set theTag to metadata tag "creation"
set theTagValue to value of theTag
end tell
close theOpenedFile
end tell
display dialog theTagValue
But when I try to iterate the files in the folder, it doesn’t work. See error message on the “set theTag to metadata tag” statement below.
tell application "Finder"
set theFileList to every file of folder POSIX file "/Users/Alan/Desktop/Test"
end tell
repeat with theFile in theFileList
tell application "Image Events"
set theOpenFile to open theFile
tell theOpenedFile
set theTag to metadata tag "creation" -- Image Events error message: Can't get image "P1000002.jpg"
set theTagValue to value of theTag
end tell
close theOpenedFile
end tell
display dialog theTagValue
end repeat
Help!
Model: iMac
AppleScript: 2.5
Browser: Safari 601.2.7
Operating System: Mac OS X (10.10)