Add tags to files using tags of parent folder

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

Moderator: Mr_Noodle

Add tags to files using tags of parent folder Tue Aug 04, 2015 2:10 pm • by soferu
I'm new to Hazel and I thought this would be a simple task but after hours of testing and reading the forum i still can't get it to work. :|

This is what i would like to achieve.

I have a folder called "Work" to which i want to apply the rules.
In the Work folder, i have project folders (i.e. Project 1, Project 2, Project 3) (in actuality there are over 100 projects)
Each of those folder has custom tags, let's say A, B, C. Some may have more than one tag so:
Project 1 - A, C
Project 2 - B
Project 3 - A, B

Within each project folder, i have files and subfolders.

I would like to set rules that would tag everything in the project folders with it's parent folder tags (current files and future files)

I've read about the "go into subfolders" rules and tried adding that to my rules in various places but I just can't get it to work.

Any help would be greatly appreciated!
soferu
 
Posts: 2
Joined: Tue Aug 04, 2015 1:27 pm

It's actually a little tricky. You can do something like:
Code: Select all
If (all) are met
    If (all) are met for (the enclosing folder)
       Tags contain A
Do
    Tag A

This would tag a file with A if the enclosing folder has the tag A. To get the nested condition, hold down the option key while clicking the + button to create a new condition. Note that you would have to do this for each tag. You can't at the moment copy all tags blindly.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Great! That worked exactly as i wanted. Since i don't have too many tags i'll do a rule for each one.

Thank you!
soferu
 
Posts: 2
Joined: Tue Aug 04, 2015 1:27 pm


Return to Support