Rename video file based on folder name

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

Moderator: Mr_Noodle

Rename video file based on folder name Wed Mar 02, 2016 4:20 pm • by GOM
Hi,

Is there a way Hazel can rename a video file name based on the name of the folder in which that file is located?

Example: the file "nameoffile.mkv" is stored inside the folder "The Wolf of Wall Street"
I would like Hazel to rename "nameoffile.mkv" to "The Wolf of Wall Street.mkv"

Any help would be much appreciated.

Thank you very much.

Kind regards
GOM
 
Posts: 1
Joined: Wed Mar 02, 2016 4:10 pm

Re: Rename video file based on folder name Thu Mar 03, 2016 11:53 am • by Mr_Noodle
You can do something like this:
Code: Select all
    If (all) are met
        If extension is mkv
        If (all) are met for (the enclosing folder)
            Name matches (•folder name)
    Do
        Rename (•folder name)(extension)


To get the nested condition, hold down option while clicking on the + button to create a new condition. There you will see the new target popup where you can specify the enclosing folder. (•folder name) is a custom attribute which you can define as (anything). What the rule above does is match mkv files whose enclosing folder's name matches anything. That second part doesn't seem useful except for the fact that is captures the name of the enclosing folder into that custom attribute. You can then use that custom attribute in the Rename action.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support