News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Read Modify Date and copy to another file

Started by mcquiff, June 23, 2014, 09:01:56 AM

Previous topic - Next topic

mcquiff

I'm using this method to read the modified date of a file.

/usr/bin/exiftool -s3 -subject -headline -usercomment -filemodifydate  /Volumes/StudioD/Users/StudioD/Pictures/CompletedFolders/TM_WK44_PSD/TM15_2.psd

I then collect the data in applescript and set the 4th paragraph to the date string. Thus = 2014:06:20 12:11:10+01:00

I am then trying to write that data back to a png or PSD file like this.

/usr/bin/exiftool -a -api PNGEarlyXMP -overwrite_original_in_place -filemodifydate=2014:06:23 12:37:45 /Volumes/StudioD/Users/StudioD/Pictures/CompletedFolders/TM_WK44_PSD/TM_2.psd
but this comes up with an error

Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in File:FileModifyDate (PrintConvInv)
Nothing to do.

I believe its in the correct format?




Phil Harvey

You need quotes around arguments containing a space:  -filemodifydate="2014:06:23 12:37:45"

Also, the -a option has no effect when writing.

- 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 ($).

mcquiff

Still getting the error?

/usr/bin/exiftool -api PNGEarlyXMP -overwrite_original_in_place -filemodifydate="2014:06:20 12:11:10+01:00" /Volumes/Images/2013-2014/WK44/TM_WK44_PSD/TM_2.png

or

/usr/bin/exiftool -api PNGEarlyXMP -overwrite_original_in_place -filemodifydate="2014:06:20 12:11:10" /Volumes/Images/2013-2014/WK44/TM_WK44_PSD/TM_2.png

I get the error: Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in File:FileModifyDate (PrintConvInv)
Nothing to do.

Should i be including the +01:00?? Although it currently makes no difference to the outcome.

Phil Harvey

Your quotes look funny.  Be sure to use standard ASCII double quotation marks, not the fancy 66/99 quotes.

- 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 ($).

mcquiff

Ah!, well spotted!

I was typing my code in on textedit in plain text mode, thinking that would be ok, not for that character!

Thankyou very much all working fine now!