Subfolders and condition

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

Moderator: Mr_Noodle

Subfolders and condition Tue Mar 31, 2015 12:22 pm • by kingkaramel
Hi,

I'm successfully using a rule with a sub-condition (cf. screenshot) to sort my image files. Now I'd like to get rid of some Aperture duplicates which can be identified through a very similar pattern matching rule. I'm not getting anywhere because I don't know how to tell Hazel that only certain files within a subfolder should be processed. Wouldn't I have to set the main condition to identify folders and then put the sub-condition in the action section (which is not possible afaik)? (How) can I do that?

Here's my rule:

Image

Thanks,
Alfred
kingkaramel
 
Posts: 4
Joined: Sun Nov 22, 2009 8:21 am

Re: Subfolders and condition Tue Mar 31, 2015 3:12 pm • by Mr_Noodle
The way you have that rule now, the sub-condition does nothing special (i.e. the conditions there can be at the top level). If you want to match files in a sub-folder, then you need to have a separate rule to tell Hazel to go into subfolders. See the sticky article at the top of this forum on how to do that.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolders and condition Tue Mar 31, 2015 3:42 pm • by kingkaramel
If I understood the article correctly, I would set the main condition to match a folder, then choose "Run on folder contents". But within the folders, I need to select certain files only. How can I set that up? I created the if -block when I tried to re-create that in the action area to achieve the following:

if folder, dig deeper -> if file within folder matches pattern -> add tags

That nested if is what troubles me...
kingkaramel
 
Posts: 4
Joined: Sun Nov 22, 2009 8:21 am

Re: Subfolders and condition Wed Apr 01, 2015 12:47 pm • by Mr_Noodle
You need separate rules. You can't do it all in one rule. Just create the rule to operate on the files as if they were at the top level.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolders and condition Wed Apr 08, 2015 1:24 am • by kingkaramel
Thanks, that helped!

--
Edit:

One more question: I just re-read the sticky. Not that I need it now, but is it correct that only rules *below* the subfolder rule will be executed on subfolders? So if I've got the same rules 1 to 4 from the sticky, but the subfolder rule ist rule #2, then rule #1 will only be applied to the root folder?
kingkaramel
 
Posts: 4
Joined: Sun Nov 22, 2009 8:21 am

Re: Subfolders and condition Wed Apr 08, 2015 4:08 pm • by Mr_Noodle
There's nothing special about the subfolder rule. Rules are evaluated in order and the first one to match is the one that gets executed. Since files that match rule #2 don't match rule #1, then it doesn't matter. But, for example, if you have another rule which matches certain kinds of folders, then you need to take that into account with the subfolder rule, which matches every folder.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support