Page 1 of 1

Checking folder contents

PostPosted: Wed Jan 11, 2012 4:45 pm
by DaMacGuy
I've been loving Hazel for a couple of years now and have pretty handy workflows

I have one though that's slightly annoying.

I place zipped files in a watched folder. Those zipped files each expand to a folder containing several files. Hazel then looks for any files with specific names (henceforth referred to as tag files), creates a new sub-folder called "tags?" (note the leading space so it's listed first, I've used the quotes in this posting only to highlight the space), and moves those possible tag files into the " tags?" folder.

This all works fine, and lets me check the suspect files before I trash them.

The problem is that if I don't intervene by checking those suspect files, Hazel will replicate the process over and over again, creating an almost infinite number of " tags?" sub-folders within " tags?" sub-folders.

I'd like to use the "contents" condition so the rule only runs if the folder content's do NOT contain a folder called " tags?". I have the following rules for on my watched folder to convert the zip files to folders, continue if there's not a folder called " tags?" and then create a " tags?" folder and move the tag files.

Rule 1 - Folder Contents
Conditions - Kind is Folder
Do the following - Run rules on folder contents

Rule 2 - Unzip
Conditions - Extension is zip
Do the following - Unarchive File

Rule 3 - Catch existing Tags folder
Conditions - Contents do not contain " tags?"
Do the following - Run rules on folder contents

Rule 4 - Move Tags
Conditions - If any of the following conditions are met, multiple name/extension starts with/end with/contains..
Do the following - Sort file into subfolder with batter > tags?

Rule 3 doesn't seem to do anything, it just gets skipped and I end up with multiple " tags?" folders.

Thoughts? Suggestions?

Re: Checking folder contents

PostPosted: Thu Jan 12, 2012 12:49 pm
by Mr_Noodle
Please keep questions to the support forum. Tips & Tricks is for if you are providing tips. See sticky article at top of that forum.

You probably want to use the subfolder level condition to limit how deep Hazel goes. Just add something like "subfolder level is 0" to the first rule and I believe that should do it.

Re: Checking folder contents

PostPosted: Thu Jan 12, 2012 1:12 pm
by DaMacGuy
Sorry for miscasting. :oops:

That seems to have done the trick too.

Thanks!