Append to file name - Hazel

Started by adrianvas12, September 17, 2016, 10:30:18 PM

Previous topic - Next topic

adrianvas12

Greeting - just like many other users I have same issues with cloud removing original Create Date from photos. I used Hazel and created this rule that will rename the file in YYYY_MM_DD_HH_MM_SS.
I would like to also append the original file name - I tried the %f but then Hazel keeps looping....
Below is my script:
exiftool -P -d '%Y_%m_%d_%H_%M_%S_%f' \
   '-filename<${FileModifyDate;}.%e' \
    '-filename<${GPSDateTime;}.%e' \
    '-filename<${MediaCreateDate;}.%e' \
    '-filename<${ModifyDate;}.%e' \
    '-filename<${DateTimeOriginal;}.%e' \
    "$1"

Ideally I would love to be able to restore the original date so that MacOS sees the correct date but not sure if that is possible.
Any help would be greatly appreciated.
AV

StarGeek

Use %%f.  From this page:

QuoteExifTool file name format codes may be used inside a date format string when a date/time tag is used to set the value of the FileName or Directory tags via the command-line interface. In this case, an extra '%' must be added to pass the format code through the date/time parser
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).