How to transfer folder name to all of its subfiles/subfolder

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

Moderator: Mr_Noodle

Folders with unique names are copied to the root of my monitored folder. How can Hazel transfer the unique folder name for each folder to all of its underlying sub elements as a tag or comment?

Kind regrads Nils
NilsMorten
 
Posts: 7
Joined: Wed May 30, 2018 7:53 am

This might be a bit tricky. First off, here's how you can grab the name of the parent folder:
Code: Select all
  If (all) are met
      Subfolder level is 1
      If (all) are met for (the enclosing folder)
          Name matches (• folder name)

See the manual for "nested conditions" if you don't know what those are. (• folder name) is a custom attribute (look it up if you are unfamiliar) set to match "anything". What this does is grab the parent folder's name which you can then re-use in other actions, like setting a tag or comment.

Now this would only be appropriate for items directly under the folder, thus subfolder level 1. The folders themselves reside at level 0.

For items further down, you can try a rule which checks the enclosing folder and see if it has a tag, and set that on itself. This would probably require that there are no other tags or comments, unless you use some sort of formatting scheme to set them apart.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support