Rule to effect only the contents of the folder

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

Moderator: Mr_Noodle

How can I put a folder "Main Folder" filled with other folders "Sub Folders" (that also have files in them) into a watched folder & have the rule move "Sub Folders" (with files still in them) to another folder & the "Main Folder" now empty moved to trash? I want to have different rule for sub folders than rule for main folder?

I tried to do this with "Run rules on folder contents" changing label colors to sub folders blue & leave Main folder no color change but it would also effect the main folder?
brianedl
 
Posts: 26
Joined: Tue Jun 05, 2012 10:08 am

Try using the subfolder depth attribute to control which folders get which actions.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

OK see pic.

Image

I need a rule applied to "Hazel Watched Folder" that will when I drop "Folder A" into it;

("Folder A" is filled with Sub-Folders "Folder B", "Folder C", & "Folder D" & the Sub-Folders have files in them as shown in pic)

Then Rule will move Sub-Folders out of "Folder A" based on the Sub-Folders name.
Example:
If Sub-Folders name is "Folder B" Then move to...
If Sub-Folders name is "Folder C" Then move to...
If Sub-Folders name is "Folder D" Then move to...

& when "Folder A" is empty then it is move to trash.

Maybe changing label color of folders will need to be part of the equation? Not sure?
brianedl
 
Posts: 26
Joined: Tue Jun 05, 2012 10:08 am

If you want it hard-coded specifically to the subfolder names then you need to have separate rules for each one. But you also need a rule to go into Folder A which you can do by reading the sticky article about going into subfolders. You then need to also create a separate rule to check if a folder is empty and to remove it. Be careful with the ordering of the rules. I suggest pausing rules on that folder and then using the preview until everything is worked out.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Look I'm sure your busy, as am I. I think this Hazel has the potential to be great for our company. I have been working my but off trying to understand how it works what it can do & how to get it to do what I need it to do the best & smartest way possible. I have been reading & reading, Posting detailed questions.

Could you PLEASE state your last response in a way that is clear like my questions. I have been running test after test & now trying to understand what you just wrote. I have read, over & over all of the
sticky article about going into subfolders
& your last response.

Could you show me an example of the structure of the rules for the specific example I spelled out above.

OR at least shown me an example of a rule that would work in my example that would simply
go into Folder A
& only effect the Folders B, C, & D in Folder A.

Maybe something simpler. How would you have it do this:

When folder A is dropped with all the folders & files inside of it as shown above.

Rule will simply:

Change Folder B, C, & D to Orange label color but not change Folder A label color. I would think this would be easy but have tried over & over with no success.
brianedl
 
Posts: 26
Joined: Tue Jun 05, 2012 10:08 am

OK again.

I figured out "a way" (not sure if it is a good or right way) to do the simple label color changes.
Instead of Folder A having no color (which I could do as well) I made Folder A have Grey for the color.

So here it is:

Image

Image

Image
Before rule:
Image

After rule:
Image

My understanding is that it will run the bottom rule 1st then run the top rule 2nd? Is that right? (Please confirm)

Now when I create a rule & put it above top rule (so it will run last) to move the sub-folders that are orange the best outcome I can get is that all the folders move together Folder A (Grey) with Folder B, C, & D (Orange).

I would like only Folders B, C, & D (Orange) to be moved or copied. Leaving Folder A behind. I would think that the following rule would be what I would need above the top rule but no.

Image

Image
brianedl
 
Posts: 26
Joined: Tue Jun 05, 2012 10:08 am

It can be much simpler. If you use the rule from the sticky article, that will tell Hazel to go into subfolders. That is what you want to get into folder A. Also, do not use the "any subfiles" target at all. That rule, as it is in the article, tells you, if you see a folder, go into it and then process the files/folders inside. If you want, you can add an extra condition that limits it to subfolder depth 0 (only do this on folders at the top level).

Now to process the folders inside, you need a way to distinguish those folders from folder A. It wasn't clear before since you went back and forth on whether you wanted subfolder depth or wanted to match specific folders by name. I'm going to assume at this point that you want every folder underneath A. For that, just do:

Code: Select all
If all met for file/folder being matched
    Kind is Folder
    Subfolder depth is 1
Then
    Move/color/whatever

This rule will match folders underneath A and move or color them or whatever you want. Put this rule before the rule to go into subfolders.

Lastly, to clear out empty folders at the top level, do:
Code: Select all
If all met for the file/folder being matched
    Kind is Folder
    Subfolder depth is 0
    Subfile/folder count is 0
Then
   Move to trash

Again, this should come before the rule to go into subfolders.

Only one rule can match a file or folder at a time so you need to order the rules to take that into account. Again, the preview will help immensely in this case.
Mr_Noodle
Site Admin
 
Posts: 11551
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

This is bull!!!!!!!! Something is very WRONG! I'm going to have a nervous breakdown here!!!!!

I'm trying to get a few things to work so that I can roll out the new work flow to our whole company, But guess what, I can't because of all the issues needing to be over come! With what seems to me to be simple crap to figure out. But over & over I keep running test & reading & coming at it from some other angle & just keep hitting wall after wall. I will take the responsibility for all of this if it is just a matter of my own stupidity. On the other hand if I can't get correct & clear answers then I'm going to come at it very frustrated, as I am. Keep in mind that Hazel is only one small piece to the whole automated workflow, but has turned into the largest due to all the difficulty getting it to do what we need it for. I can't believe it is turning out this way. I bought Hazel thinking that it was going to be amazingly easy & do all kinds of tedious stuff for us.

I really am holding out that it will still be an amazing program but am very pissed at this point. If I can get passed the present difficulties then I am hoping this will get better & better for us with what it can do & how to do it.

So, You wrote for me to:

Image

& this is what it did, nothing?

Image

Do you have any idea why this does nothing? Shouldn't it work on its own or does it need to be a part of something else? Is it a bad rule, is something wrong with Hazel, my Hazel. Its really bad I can't get your rules to work; this is what I have been going through most all day long since I bought it when I try to do something that, like I said would seem to be simple.
brianedl
 
Posts: 26
Joined: Tue Jun 05, 2012 10:08 am

This is very easy.
Set these rules for your Hazel Watched Folder:

Rule 1: Move folders BCD
Code: Select all
if all
kind is folder
subfolder depth is 1

then
move

Rule 2: Delete empty folder A
Code: Select all
if all
kind is folder
subfolder depth is 0
sub-file/folder count is 0

then
Move to Trash

Rule 3: Go into folders
Code: Select all
if all
kind is folder
subfolder depth is 0

then
run rules on folder contents

Some notes:
    - If you want to move your folders B C and D to different places according to name, you will need to set up a separate rule for each folder and add a "name matches Folder X" criteria.
    - Similarly, if folder A has a specific name that you want matched, then you need to include that in your rules.
    - Rules run from top to bottom in a loop. So if the only rule that matches is the last one, that will obviously run first. The order in which rules run can affect whether your rules work the way you want them to, so pay attention.
    - Hazel is a very capable program that (mostly) does only what you tell it to. If its not working it is a problem with your rules, not the program.
I will take the responsibility for all of this if it is just a matter of my own stupidity.

I think you owe Mr. Noodle an apology.
Skeo
 
Posts: 31
Joined: Mon Jan 02, 2012 7:53 pm


Return to Support