Page 1 of 1

Trouble processing rules one subfolder deep.

PostPosted: Wed Aug 10, 2011 2:47 am
by neverminding
I've tried a combination of solutions without getting the expected results, so I was wondering if anyone could help.

What I want to happen is this: In the Downloads folder, if any subfolder contains Music files, I want to import them into a playlist in iTunes. I already have a rule that processes Music files in the Downloads folder itself (as these single files go into a different playlist).

I tired setting Subfolder Depth is 1, then Kind is Music, but Hazel doesn't even find the files. (For instance Downloads/Mars Volta/Song.mp3).

Any help would be appreciated.

Ron

Re: Trouble processing rules one subfolder deep.

PostPosted: Wed Aug 10, 2011 11:09 am
by justinkthornton
Instructions are found here.

viewtopic.php?f=4&t=470

If you don't get it let me know. I'm happy to help.

Re: Trouble processing rules one subfolder deep.

PostPosted: Wed Aug 10, 2011 7:24 pm
by neverminding
I tried using the basic instructions in the sticky post, but it doesn't seem to work for this case.

I'll try to be a little more specific.

1) I have a rule for my Downloads folder that takes music files in the folder itself (not nested in other folders) and puts them in a "New Singles" iTunes playlist. It works as expected. The rule looks like this:

Image

2) The second rule I'm trying to create will look in folders in the Downloads folder for music files and put them in a separate playlist titled "New Albums", based on the condition that they are nested in a subfolder, like this:

Image

The rule:

Image

I've tried every possible combination to look into the subfolder but I can't get Hazel to even recognize the music files are there. I feel like I'm missing something obvious.

Ron

Re: Trouble processing rules one subfolder deep.

PostPosted: Wed Aug 10, 2011 7:54 pm
by justinkthornton
To run a rule that looks into a subfolder you always have to have another rule that looks like this:

If

kind is folder

then

run rules on folder contents.


If you add anything else to the rule it won't work.

First, before we can go on. Do you have a rule that looks exactly like this one?

Re: Trouble processing rules one subfolder deep.

PostPosted: Wed Aug 10, 2011 8:15 pm
by neverminding
Hm. I do not.

Does this have to be its own rule? I'm not sure I understand. If you need this condition, then there is no way to say "run rules only on music files" since they cannot be combined with "kind is folder" rules.

Is there a way to say "run rules on folder contents IF they are music files"?

Re: Trouble processing rules one subfolder deep.

PostPosted: Wed Aug 10, 2011 9:22 pm
by justinkthornton
It has to be it's own rule. It can contain nothing else.

It basically tells the rest of the rules that they can look into the subfolders. But it will tell all the rules to look into the subfolders. That means you have to be extra careful and creative in how you make your rules, otherwise it will do all sorts of unintended things.

This, I believe, will be changed in version 3 so you can only tell one rule to look into the subfolders.

Re: Trouble processing rules one subfolder deep.

PostPosted: Fri Aug 12, 2011 3:58 pm
by Mr_Noodle
It won't work quite like that.

Basically, just look at the rule. The subfolders rule has to be separate because that rule matches folders. It makes no sense to add conditions and actions pertaining to files. Take each entity and match it against the rule. Does it make sense for that rule to be a folder as well as a music file at the same time? Most likely, no. In such a case, you need to separate that logic because you are mashing two concepts together in one.