Author Topic: Read Modify Date and copy to another file  (Read 1636 times)

mcquiff

  • Jr. Member
  • **
  • Posts: 27
Read Modify Date and copy to another file
« on: June 23, 2014, 09:01:56 AM »
I'm using this method to read the modified date of a file.

Code: [Select]
/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.

Code: [Select]
/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.psdbut 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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Read Modify Date and copy to another file
« Reply #1 on: June 23, 2014, 09:23:41 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mcquiff

  • Jr. Member
  • **
  • Posts: 27
Re: Read Modify Date and copy to another file
« Reply #2 on: June 23, 2014, 10:12:42 AM »
Still getting the error?

Code: [Select]
/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

Code: [Select]
/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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Read Modify Date and copy to another file
« Reply #3 on: June 23, 2014, 10:55:37 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mcquiff

  • Jr. Member
  • **
  • Posts: 27
Re: Read Modify Date and copy to another file
« Reply #4 on: June 23, 2014, 11:09:34 AM »
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!