Tag all content in subfolder based on top folder name

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

Moderator: Mr_Noodle

Hi

I want to tag all files folders (and subsequent subfolders and files) with one tag called "KVIK" the some parts of the top folder's name has "KVIK" in it.

So - if a top folder is called e.g. "KVIK programs", I want to tag that top folder with "KVIK", but I also want to tag ALL subfolders (and their subfolders) AND all files in ALL subfolders with "KVIK".

Can this be done?
jensjakobsen
 
Posts: 3
Joined: Fri Aug 21, 2020 1:22 am

Are there other tags? Is it only the "KVIK programs" tag or any tag that the top level folder has?
Mr_Noodle
Site Admin
 
Posts: 11251
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

So - all top folders may, or may not have a tag called "KVIK".

The example "KVIK Programs" refers to a folder not a tag.

Ideally I would like for a Hazel rule to be applied to my HOME folder, (CMD + SHIFT + H), and the Hazel rule would crawl through all folders and sub-folders and it should:

    1: Detect and TAG all folders that contains the name "KVIK" (also if there are no top folders containing the name "KVIK")
    2: Tag all sub folders and files once a top folder contains the name "KVIK"
    3: Crawl to the bottom of all the sub folders once a folder contains the name "KVIK", and tag anything on its way (files and folders)
jensjakobsen
 
Posts: 3
Joined: Fri Aug 21, 2020 1:22 am

Sorry, misread your post. Is this a one time operation or ongoing? It's a bit dangerous and very resource-intensive to have Hazel monitor your whole home folder and have it descend into subfolders. You might want to consider creating a Smart Folder and having Hazel monitor that.

You can create a rule that will tag a file based on its parent using nested conditions once you have the above sorted out.
Mr_Noodle
Site Admin
 
Posts: 11251
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks Mr. Noodle - I would want this to be an on-going operation, but I could do with a smart folder. Does it mean that I have to find the actual smart search file normally located at "~/Library/Saved Searches"?

Thanks.
jensjakobsen
 
Posts: 3
Joined: Fri Aug 21, 2020 1:22 am

Yes. You can then have Hazel monitor that and apply rules to the results of the search.
Mr_Noodle
Site Admin
 
Posts: 11251
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron