Page 1 of 1

Sub-folders with specific rules...

PostPosted: Mon Mar 29, 2010 12:26 pm
by Flynntargart
Hey all,

I'm loving the demo of Hazel- so far it's been by far the most useful app I've used!

I have a question though...
I've got a downloads folder, and within it, often I get sub folders (when archives are expanded, or downloads come down in folders, etc). I read the subfolder rule guide in this Support forum, and the "Run rules on subfolders" functionality is great... except that I've got some rules that are very specific to other folders and I don't want them to be triggered by any matches that the Downloads folder might present.

Is there a way to, either in Hazel or via Applescript, to specify the rules that are run on sub folders?

It would really be ideal if when creating a rule you could just click a button that said "Also run this rule on subfolders"... :?:

Re: Sub-folders with specific rules...

PostPosted: Mon Mar 29, 2010 2:17 pm
by Mr_Noodle
It depends. There is the "subfolder depth" attribute which is how many levels down from the top level you are (with 0 being the top level). So, if you want a rule to only operate on subfolders (and below), you can do:

If Subfolder Depth is greater than 0, ...

Not sure if this answers your question or if you had something different in mind in which case, please elaborate.

Re: Sub-folders with specific rules...

PostPosted: Sun Apr 04, 2010 1:11 pm
by Flynntargart
Sorry for my late reply,

That gives me an idea, but is effectively the opposite of what I want.

What I would like is:
If subfolder depth is > 0 do not run

So, for example, when I download an episode of Heroes, if it is in a folder, I can let that rule run in subfolders. However, if I download a zip file- an application for example- I don't want my PDF sorting rule to go into the unzipped folder and yank the guide to the application until I've had a chance to look at it.

So, the Heroes rule would be allowed to run in sub folders, but the PDF rule would not be.

To do that, I should add a condition to the PDF rule saying that folder depth must = 0?

Re: Sub-folders with specific rules...

PostPosted: Mon Apr 05, 2010 2:07 pm
by Mr_Noodle
If you don't want to go into a certain folder, just modify the rule to filter those folders out. If you have:

If Kind is folder, run rules on folder contents

All you have to do in your case is add extra conditions to that rule to further specify which folders it should go into.

As for being able to distinguish between the different types of folders, that depends on you. For instance, if you want to set apart unarchived folders, in the rule that does the unarchiving, have it also color the folder after unarchiving and then add a condition to the rule above to filter those out.

Re: Sub-folders with specific rules...

PostPosted: Mon Aug 16, 2010 11:50 am
by groomedmonkey
Where is this "subfolder rule guide" that gets mentioned in a few threads? I am having trouble getting a very basic set up working with Hazel. I just want (to start with) a duplicate of the default "Newly Added Files" rule that ships with Hazel to work on subfolders in the Downloads folder. I use Speed Download which organises file downloads into categories. I have tried adding:

1. "Subfolder Depth is greater than 0"
2. "Subfolder Depth is 1"

no highlighting of "new" downloads in subfolders.

Re: Sub-folders with specific rules...

PostPosted: Fri Aug 20, 2010 4:07 pm
by Mr_Noodle
It's the pinned post at the top of the Support forum. Here's a direct link: viewtopic.php?f=4&t=470