Here is a brief AppleScript that can access the internal image EXIF data written by the camera. In particularly, it prompts you for the camera image, and outputs a dialog containing the DateTimeOriginal field (when the picture was taken).
- You can launch Script Editor from Dock : Launchpad : Other : Script Editor.
- Copy and paste the following code into Script Editor, and click the hammer icon (compile).
- Click Run, and it will open a file chooser on your Pictures folder. Select one image file.
- A dialog will appear showing the internal date (DateTimeOriginal) that the picture was taken.
Output:
Note: if you click the document icon on the bottom toolbar of Script Editor, when you run the script, you can see all of the other EXIF data information for the image.
use scripting additions
use framework "Foundation"
use framework "AppKit" -- for image stuff
set valid_types to {"public.jpeg", "public.camera-raw-image"}
set POSIXPath to POSIX path of (choose file of type valid_types default location (path to pictures folder))
set DTO to DateTimeOriginal of (my readEXIFFromJpeg:POSIXPath)
if exists DTO then
display dialog "DateTimeOriginal: " & DateTimeOriginal of (my readEXIFFromJpeg:POSIXPath) with title "EXIF Data"
end if
return
on readEXIFFromJpeg:POSIXPath
set theImageRep to current application's NSBitmapImageRep's imageRepWithContentsOfFile:POSIXPath
set theEXIFData to theImageRep's valueForProperty:(current application's NSImageEXIFData)
if theEXIFData is missing value then return false
log (theEXIFData) as record
return theEXIFData as record
end readEXIFFromJpeg: