Stop Running Rules on Folder Contents (or workaround)?

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

So am trying to run a nightly backup of a specific folder in my Application Support directory. The problem is, there is one folder within that folder called Images, and it is huge, so I want to discard it from the backups. My Hazel rules so far run like so:

Code: Select all
Application Support
--------------------------------
    If (all):
        Kind is Folder
        Name is xxxxxx
        Date last matched is not within last 1 day
    Then:
        Copy to Backups
        Rename file with pattern: Date Modified
--------------------------------

Backups
--------------------------------
    If:
        Kind is Folder
    Then:
        Run rules on folder contents
--------------------------------
    If (all):
        Kind is Folder
        Name is Images
    Then:
        Move to Trash
---------------------------------

And this is where I run into the problem: I need to compress the backed-up folder (now named with the date). However, I can't run any more rules on it because I already told it to run rules on folder contents. Is there someway at the end of the "Move Images to Trash" rule that I can say 'Don't run rules on folder contents anymore'? Or can anyone see a workaround? If I could somehow exclude the images subfolder from the original copy, I could just copy, rename, and compress in one rule.
nickchristensen
 
Posts: 4
Joined: Mon Apr 05, 2010 10:49 pm

Well two suggestions.

The first is i would change your process, unless there is a reason you are running it on the App Support Folder.

Folder XXXX (within App Support
-----------------------------------------------
If (all):

Kind is Folder
Full Name is not Images
Date Last Matched is not within last 1 day

Then:

Copy to Backups
Sort into subfolder: >Date Modified (the greater than symbol is the triangle modifier [means created new folder] along with date modified)
---------------------------------

Backups

---------------------------------

If (all):
If Date Added is after Date Last Matched
If kind is folder

Then:
Archive


Thats should do it. And if the Folder XXX does not just contain folders at that first level but files as well, then just run another rule just for the files, then sort those into the newly created folder from the above rule and then run the archive rule.

Or see this post here about getting rules to go back up to parent using applescript.

viewtopic.php?p=1545#p1545

Cheers.
dhy8386
 
Posts: 94
Joined: Tue Nov 09, 2010 12:19 pm

Thank you so much, that did it. I knew Hazel was smarter than me, and was probably just approaching it with the wrong mental model.
nickchristensen
 
Posts: 4
Joined: Mon Apr 05, 2010 10:49 pm


Return to Open Discussion