Page 1 of 1

Rename file based on Folder name with tokens

PostPosted: Thu May 05, 2016 9:23 pm
by joshsmith01
I'd like to rename my files based on what folder they reside. But, If I could use a token I wouldn't have to hardcode each rule for each folder. Can I use a token to check the current containing folder's name?

I'd like to check to see if the name already matches if the file doesn't match change it, if it does match ignore it.

Re: Rename file based on Folder name with tokens

PostPosted: Fri May 06, 2016 12:39 pm
by Mr_Noodle
You can use a nested condition (hold down option key while clicking the + button). Once you have that you can set it up like this:
Code: Select all
If (all) match
    If (all) match for (the enclosing folder)
        Name matches (• parent name)
    Name matches (•parent name)

Here, parent name matches (anything) so it will just store the whole name into that attribute. When a custom attribute is re-used, if it was already matched, it will require you to match the value it captured before. So in this case what this does is require that the current file has the same name as its parent folder.