On 9 May 2014, at 11:00 am, Martin Orpen < email@hidden> wrote: On 9 May 2014, at 00:34, Shane Stanley <email@hidden> wrote:
I'm not sure from your post whether you want only the EXIF values, or the other stuff as well. If only the EXIF values, and you're running Mavericks, you can get it directly as an AppleScript record via a script library, without having to bother with EXIFTools.
[snip]
Shane
That’s very useful.
Is Mavericks able to grab IPTC data from images using a similar method?
Coming back to this topic, you can now gather all the metadata if you have the ASObjCExtras framework installed. The library script would be like this:
use framework "Foundation" use framework "ASObjCExtras"
on metadataFrom:imageFile set {theRecord, theError} to current application's SMSFord's metadataFromImage:imageFile |error|:(reference) if theRecord = missing value then -- there was a problem, so extract the error description error (theError's localizedDescription() as text) -- number (theError's code()) else return theRecord as record end if end metadataFrom:
And you'd call it like this:
tell script "<lib name>" set theMetadata to its metadataFrom:(choose file) end tell
The result will naturally depend on the image and the camera it was shot on, but this is from a sample taken on an iPhone:
--> {|{tiff}|:{ResolutionUnit:2, Software:"iPhoto 9.4.3", DateTime:"2013:04:24 13:54:01", XResolution:72.0, Orientation:1, YResolution:72.0, Model:"iPhone 5", |make|:"Apple"}, Depth:8, |{exif}|:{DateTimeOriginal:"2013:04:24 13:54:01", ComponentsConfiguration:{1, 2, 3, 0}, BrightnessValue:9.038889884949, FNumber:2.400000095367, FocalLength:4.130000114441, ShutterSpeedValue:10.111389160156, SubjectArea:{1631, 1223, 881, 881}, ApertureValue:2.526068925858, SceneCaptureType:0, ColorSpace:1, PixelYDimension:3264, WhiteBalance:0, FlashPixVersion:{1, 0}, DateTimeDigitized:"2013:04:24 13:54:01", ISOSpeedRatings:{50}, ExposureMode:0, PixelXDimension:2448, ExifVersion:{2, 2, 1}, ExposureProgram:2, ExposureTime:9.04159154742956E-4, Flash:16, SensingMethod:2, FocalLenIn35mmFilm:33, MeteringMode:5}, PixelHeight:3264, |{jfif}|:{DensityUnit:1, YDensity:72, JFIFVersion:{1, 1}, XDensity:72}, ProfileName:"sRGB IEC61966-2.1", DPIWidth:72.0, DPIHeight:72.0, ColorModel:"RGB", Orientation:1, PixelWidth:2448}
|