Change color of all parent folders

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

Moderator: Mr_Noodle

Change color of all parent folders Tue Jan 30, 2018 2:45 pm • by stevelucky76
I'm trying to create a rule that looks to see if a folder has a red color label (or is it tag? Not sure what the difference is) and sets all parent folders to have a red label as well. I've read this thread: viewtopic.php?f=4&t=825 but it seems to just set the top-most parent folder to red and nothing in between. If I have a structure such as:

Image

And Folder 1 contains a red color label (It may also have gray, or something else as well) then the rule would add a red label to Folder B as well as Folder Z as Folder 1 is nested inside of them. Folder A would get left alone as it is not a parent of Folder 1. Does that make sense? Is something like that possible?
stevelucky76
 
Posts: 16
Joined: Fri Apr 23, 2010 10:58 pm

Re: Change color of all parent folders Tue Jan 30, 2018 9:47 pm • by stevelucky76
For what it's worth I think I found a pretty simple solution to my problem that doesn't require any Applescript. I accomplished it using the following rule:

Image
stevelucky76
 
Posts: 16
Joined: Fri Apr 23, 2010 10:58 pm

Re: Change color of all parent folders Tue Jan 30, 2018 9:53 pm • by stevelucky76
Hmmm. On second check this is hit or miss. Sometimes it will only tag the top level folder red and sometimes it will do all of them (which is what I'm looking for). Back to the drawing board. I need a way for it to execute on the lower level folders first and then back it's way out or something like that.
stevelucky76
 
Posts: 16
Joined: Fri Apr 23, 2010 10:58 pm

Re: Change color of all parent folders Wed Jan 31, 2018 12:23 pm • by Mr_Noodle
Try going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

That should help in the case where only the top-level folder is being colored.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Change color of all parent folders Sat Jul 21, 2018 7:54 pm • by jbthehutton
There are screenshots missing from this thread (for me at least) so I can't see the solutions referenced. I'm trying to do something very similar, I think. I have a colleague who has an insane practice of starting a new work project with a huge hierarchy of empty folders. Before I implore him to stop, I thought hazel might help by adding a color label or a tag to any folder that contains a document in it somewhere. What I think I want is a rule that matches "if folder contents contains document" or "if folder contents contains folder with tag "containsDocs" then add tag "containsDocs" and label 'red". There is a "number of items" to count everything, but I only want to count documents.
If there was a way to search the whole hierarchy at once "if folder contains document up to 10 levels deep" then I could apply it to subfolders and be done.
Another way would be to refer to the enclosing folder somehow: "if kind is document add tag to enclosing folder: "containsDocs", but I don't see a way to act on the enclosing folder.
Does this require a script? Surely, I'm not the first to ask this?
jbthehutton
 
Posts: 2
Joined: Sat Jul 21, 2018 7:28 pm

Re: Change color of all parent folders Sat Jul 21, 2018 8:04 pm • by jbthehutton
Duh. After an hour I figured out a workaround: Any folder that contains more than folders will have a size of more than 100bytes. Simple
jbthehutton
 
Posts: 2
Joined: Sat Jul 21, 2018 7:28 pm

Re: Change color of all parent folders Mon Jul 23, 2018 12:15 pm • by Mr_Noodle
You can also do it by using nested conditions. Search for them in the help. You can do something like "If all match for any sub-file...".
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support