OK I am calling EXIFTool via AppleScript Shell Script from within a FileMaker Pro script.
Was having issues with THIS
set pathPOSIXFile to quoted form of POSIX path of ("PATH TO MY IMAGE FILE" as alias)
set dateTimeCreated to (do shell script "'PATH TO EXIFTOOL' -createdate " & pathPOSIXFile) as string
set dateTimeModified to (do shell script "'PATH TO EXIFTOOL' -modifydate " & pathPOSIXFile) as string
the second step was NOT getting the correct file modification datetime
SO I changed to this
set pathPOSIXFile to quoted form of POSIX path of ("PATH TO MY IMAGE FILE" as alias)
set dateTimeCreated to (do shell script "'PATH TO EXIFTOOL' -createdate " & pathPOSIXFile) as string
set dateTimeModified to (do shell script "'PATH TO EXIFTOOL' -filemodifydate " & pathPOSIXFile) as string
And NOW I get the correct file modification datetime
BUT isn't this inconsistent? Then when I tried to do this
set pathPOSIXFile to quoted form of POSIX path of ("PATH TO MY IMAGE FILE" as alias)
set dateTimeCreated to (do shell script "'PATH TO EXIFTOOL' -filecreatedate " & pathPOSIXFile) as string
set dateTimeModified to (do shell script "'PATH TO EXIFTOOL' -filemodifydate " & pathPOSIXFile) as string
It didn't work!
Most of the files are TIFF some JPEG some PSD
Please advise best syntax for retrieving both file creation and file modification datetimes?
CreateDate and ModifyDate are the timestamps embedded in the EXIF block (and possibly elsewhere). FileCreateDate and FileModifyDate are the file system timestamps. They are completely different timestamps.
See EXIF tags (https://exiftool.org/TagNames/EXIF.html) and Extra Tags (https://exiftool.org/TagNames/Extra.html) for details.
As to why you can't read the file system tags in the last instance, I'm not sure. I know you can't write to FileCreateDate on the Mac unless you have setfile available (see FileCreateDate entry on the Extra tags page), but I don't believe that should stop reading. But then, I don't use a Mac.
OK so for accuracy I'd prefer to stay with the SYSTEM tags so how would I use the RequestAll command in my line of code so that way I could use FileCreateDate ?
'PATH TO EXIFTOOL' -filecreatedate 'PATH TO FILE'
THX!
Just -FileCreateDate should be enough to list it. Setting -api RequestAll=2 would be the call but it will create more tags than you would normally need.
Huh... Neither using just
-FileCreateDate
or
-api RequestAll=2 -FileCreateDate
worked :( No data returned at all
Using Mac OS Yosemite on TIFF files
Does it work when run from the command line rather than in the script?
What version of ExifTool are you using?: exiftool -ver
- Phil