Sub folders issue

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

Moderator: Mr_Noodle

Sub folders issue Wed Mar 23, 2022 8:10 am • by Danny Wyatt
I'm quite new to Hazel and I seem to understand the "sub folder" rule (Run Rules on Folder Contents), but I'm having a hard time setting a certain rule. I tried different rule orders, no luck.
Here's my test folder:
Image

Now I want to move all files with the RED tag, to Folder 1
Image

Once they are inside Folder 1, I want to process the sub folder
Image

And all the files with the RED tag, will then add the GREEN tag
Image

So basically this would be the end result:
Image


As I mentioned, I tried moving the "Run rules on folder contents" to the 1st, 2nd and 3rd positions, but it never works.
It moves the RED tag files to the folder, but then it doesn't add the GREEN tag.
Am I missing something here?
Danny Wyatt
 
Posts: 25
Joined: Wed Mar 23, 2022 7:39 am

Re: Sub folders issue Wed Mar 23, 2022 9:27 am • by Mr_Noodle
The position of the subfolder rule is not important here. The problem is that any files with red tags always get matched by the first rule. Is there a reason why your first rule doesn't add the green tag after moving the file?
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sub folders issue Wed Mar 23, 2022 1:49 pm • by Danny Wyatt
Mr_Noodle wrote:The position of the subfolder rule is not important here. The problem is that any files with red tags always get matched by the first rule. Is there a reason why your first rule doesn't add the green tag after moving the file?


I thought that rules run in order, top to bottom?
So it would first run the rule to move the red tag files to the folder and when that is done (since the root doesn't have any other files with the red tag) it would move on to the next rule and then finally the rule that adds the green tag to the files with the red tag. I'm a bit confused why it isn't working like this...

Right now, the rule to process the sub folder, is not doing anything (apparently).
If I remove it, then I will get the same result, because once the file is inside the folder, it will not be able to process it.

Answering your question about the 1st rule adding the tag: yes, it could for this particular example, but I'm testing how the app works, because of other scenarios I need it to work differently. I'm trying to understand the whole process, because the rule to process the folder's content, is still a bit confusing and not working as I expect it to work.

For example, I have a folder on my computer called INBOX. This is where I drop all my files throughout the day.
At night, I go over the files and depending on each topic, I add a tag and based on each tag, it automatically moves those files to specific folders (e.g. Drum Lessons, Coding, Workout, etc).

Now here's the issue: if I include the rule to process sub folders, I'm able to process files inside a folder inside Inbox (e.g. Drums), but what if I create a folder inside INBOX and I want the whole folder to be moved based on a tag?
I add the tag "drums" to the folder, but since the rule is set to process the folder's content, the folder itself is not being moved. The only way to fix this is to disable the rule to process sub folders.
As much as this works, manually, I would like to not think about it at all and have it done automatically. That's why the order of the rule to process the folder's content seemed important to me.

My goal is that I first go over each folder, add the tags manually, and let Hazel move the files to the specified folders.
Then if by any chance I have a folder (with files in it) I want to move as well, I want to be able to add a tag to the folder and have it moved. Can't seem to understand how to achieve this without disabling the rule.

Is it making sense?
Danny Wyatt
 
Posts: 25
Joined: Wed Mar 23, 2022 7:39 am

Re: Sub folders issue Wed Mar 23, 2022 2:01 pm • by Danny Wyatt
Mr_Noodle wrote:The position of the subfolder rule is not important here. The problem is that any files with red tags always get matched by the first rule. Is there a reason why your first rule doesn't add the green tag after moving the file?


Ok I guess the app was first going through some kind of glitch, because it was processing the folders now.
I also noticed that if I have the rule to process the content at the top of the list, folders are not being processed. If I move it to the bottom of the list, they do. So I guess the rule needs to always be at the bottom?

Let me know if this is how it works:
If I have 6 rules + 1 at the bottom to process each folder's content, it first runs all of those first 6 rules on the root content (files and folders - not the content, just the folders themselves). Once it's done, it reads the last rule (to process folders content) and applies those same 6 rules to all folders content (and their sub folders). Is it?
Danny Wyatt
 
Posts: 25
Joined: Wed Mar 23, 2022 7:39 am

Re: Sub folders issue Thu Mar 24, 2022 12:48 pm • by Mr_Noodle
Rules are evaluated in order but once a match is found, evaluation stops unless you use the "Continue" action. Also, evaluation always starts at the top so even though your first rule matched, the file gets moved. When it encounters the file later in the subfolder, it starts from the top of the list again.

If you want certain rules to only match in certain places, you need to add conditions to specify that. Subfolder level is one way to do that.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support