Mark Folders containing files, not only Subfolders

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

Moderator: Mr_Noodle

Hello forum!
I want to create a rule that allows me to mark folders that contain files at the end of the folder hierarchy. Example:

Folder1/Subfolder1/File.xxx (Folder1 contains just Subfolder1, no Files) -> Folder1 and Subfolder1 should be marked
Folder2/Subfolder2/ (Subfolder is empty, contains no Subfolders/Files) -> Folder2 and Subfolder2 should not be marked

The "Sub-file/Folder count" rule does not work here. Neither does the "Size" rule, because folders can have a size > 0, even if they do not contain any visible file.

Is that possible using Hazel?

Thank you!
Sebaster
 
Posts: 2
Joined: Tue Mar 02, 2021 7:38 am

You can use nested conditions. Look them up in the manual. You can have a nested condition which will match a folder based on the items within it. For example:
Code: Select all
If (all) are met
    If (all) are met for (any of its sub-files)
        Kind is not Folder


That will match a folder if it has anything underneath it that isn't a folder.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Cool! Thank you!
Sebaster
 
Posts: 2
Joined: Tue Mar 02, 2021 7:38 am


Return to Support