TIFF File Creation Date vs Modification Date ISSUE

Started by kswaha, February 24, 2021, 03:41:00 PM

Previous topic - Next topic

kswaha

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?

StarGeek

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 and Extra Tags 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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

kswaha

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!

StarGeek

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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

kswaha

Huh... Neither using just

-FileCreateDate

or

-api RequestAll=2 -FileCreateDate

worked :( No data returned at all

Using Mac OS Yosemite on TIFF files

Alan Clifford

Does it work when run from the command line rather than in the script?

Phil Harvey

What version of ExifTool are you using?:   exiftool -ver

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).