Exif tool use and examples

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Exif tool use and examples Sat Sep 17, 2016 10:14 am • by adrianvas12
Greetings - just like many of you probably, I am trying to build a workflow where all my pictures are synced to cloud and from there Hazel takes care of business as usually. I am running into the the same problem as everyone - cloud provider modifies CreateDate and this is causing issues.

I am still learning Hazel and I looked around but could not figure out how to run a script to pass the created date from Exif to Hazel. I understand that the script will write that into a variable and that should be passed to Hazel .... still could not get it to work.
Basically my images are coming IMG_1234.JPG - I would like to be able to have something like YYYY_MM_DD_HH_MM_SS_IMG_1234.JPG
Then use that info with Hazel to sort into Year Month folder - I can do this part; is just the passing of variable that doesn't work.
I appreciate any feedback.

AV
adrianvas12
 
Posts: 2
Joined: Sat Sep 17, 2016 10:06 am

Re: Exif tool use and examples Mon Sep 19, 2016 11:42 am • by Mr_Noodle
Shell scripts cannot pass variables back to Hazel. You'll need to use JavaScript/AppleScript to do that. Those can call shell scripts so a hybrid approach is doable.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Exif tool use and examples Mon Sep 19, 2016 6:55 pm • by adrianvas12
Mr_Noodle wrote:Shell scripts cannot pass variables back to Hazel. You'll need to use JavaScript/AppleScript to do that. Those can call shell scripts so a hybrid approach is doable.


Thank you for your answer. I am using it successfully and I can rename files - the issue I have is that I cannot append the original file name to the end. Here is my script:
Code: Select all
exiftool -P -d '%Y_%m_%d_%H_%M_%S' \
   '-filename<${FileModifyDate;}.%e' \
    '-filename<${GPSDateTime;}.%e' \
    '-filename<${MediaCreateDate;}.%e' \
    '-filename<${ModifyDate;}.%e' \
    '-filename<${DateTimeOriginal;}.%e' \
    "$1"


And here is a screen shot of Hazel:
http://pasteboard.co/58pafRJZi.png

So it has to be a -parameter that will keep the name; I read that
Code: Select all
%f
does it but was not able to get it to work.
AV
adrianvas12
 
Posts: 2
Joined: Sat Sep 17, 2016 10:06 am

Re: Exif tool use and examples Tue Sep 20, 2016 10:34 am • by Mr_Noodle
I'm afraid I'm not following here. Can you give me an example?
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support