Rename file based on Folder name with tokens

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.
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.