Rules are trashing parent folders instead of files

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

Moderator: Mr_Noodle

I have a directory made up of several subdirectories. Each of these subdirectories contains one or more HTML files (which are generated by a program I've written). Often times, the HTML files will not contain actual data, but just a header/footer set. These "empty" files will always be less than 5kb in size (and non-empty files will always be substantially larger). I'm trying to remove these files automatically using Hazel.

Here's my rule, applied to the top directory (called "output"):

Image
Click for large view

When I run this rule, it Trashes all of the folders that contain any of the "empty" files (which, incidentally, also house lots of non-empty files that are also moved to the Trash).

This may be my own inexperience with Hazel (I'm a relatively new user), but this operation seems pretty straightforward.

What am I doing wrong?

(Also, forgive me if this is a duplicate — I searched before posting this, but didn't find anything that addressed this issue).

Thanks!
inkedmn
 
Posts: 1
Joined: Thu Apr 05, 2012 4:51 pm

I am assuming that this rule monitors your "output" directory?

Anyhow, the problem is that your rule applies to "Subfiles and Folders." - Change that to "Current File or Folder" and you should be set.

You will also need a rule that dives into subfolders. See the sticky at the top of the forum for detailed instructions on how to do that.

Essentially, add another rule to "Output":
Code: Select all
if (all) of the following conditions are met for (current file or folder)
    kind IS folder
   
then
    Run rules on folder contents
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado


Return to Support