Page 1 of 1

Rename file name based on EXIF date

PostPosted: Wed Jun 03, 2015 11:49 pm
by 2MyCloud
Please accept my apologies in advance if this is the wrong place to post this forum. I have just purchased Hazel to help with renamining thousands of photos, but I am complete novice.

I'm trying to create a rule to rename pictures. My naming convention is Marketing_Photo_YYYYMMDD_location_counter.ext, where:

- YYYYMMDD is the date the picture was taken, based on EXIF information
- Location is where I took this picture. This information, in particulare, should be inherited from the folder name the picture is in. More on this later.
- counter is a 4 digit counter that should restart from 0 every time the picture date changes
- ext should be jpg (lowercase)

My target workflow is:
1. Have Hazel to look for new content in the To_be_Processed folder and sub-folders and rename the picture according to the rule aforementioned, taking the location name form sub_foldername dropped into the To_be_Processed folder
2. Have hazel to move the images into path location to the top level Master folder (i.e. /username/photos/Master/).

I have download Exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/) to help properly read the EXIF info.

Any idea if this is possible in Hazel and how? I am new to scripting as you can see.

Re: Rename file name based on EXIF date

PostPosted: Thu Jun 04, 2015 11:07 am
by Mr_Noodle
Search the forums about getting the EXIF date using exiftool.

Check the sticky article about getting Hazel to go into subfolders.

As for getting the location name from the folder name, that is a bit more tricky. You'll need to do something like this:
Code: Select all
If (all) are met
    If (all) are met for (the enclosing folder)
        Name matches <some pattern which grabs the location and sticks it into a custom attribute>
    <other conditions>
Do
    Rename <pattern which uses the location custom attribute you defined above>


Search the help for "match patterns" on the pattern stuff. To get the sub-condition, hold down option while clicking the + button to create a new condition. There, you'll see the extra target pop-up to select the enclosing folder.

As for renumbering, you can set Hazel to renumber if a file already exists, but you can't control the format of it. Alternatively, you can use the counter token (#) in your pattern though that applies to the whole folder. There's no way to have it only count certain types of files in the same folder. You'd have to split the files up into their own date folders for that to work.

Re: Rename file name based on EXIF date

PostPosted: Sat Jan 21, 2017 6:17 pm
by ryansebiz
I'm also looking for a way to rename JPG to jpg (I'll move it to another folder afterwards so it doesn't risk running the rule again).

Any way to do this?

Re: Rename file name based on EXIF date

PostPosted: Tue Jan 24, 2017 2:52 pm
by Mr_Noodle
In the rename action, click on the Name attribute. There will be different capitalization options there.

Re: Rename file name based on EXIF date

PostPosted: Tue Jan 24, 2017 3:01 pm
by ryansebiz
Mr_Noodle wrote:In the rename action, click on the Name attribute. There will be different capitalization options there.


Thanks Mr_Noodle - that worked! Keep up the awesome work on the app!