Page 1 of 1

Mark Folders containing files, not only Subfolders

PostPosted: Mon Mar 15, 2021 7:12 am
by Sebaster
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!

Re: Mark Folders containing files, not only Subfolders

PostPosted: Mon Mar 15, 2021 9:18 am
by Mr_Noodle
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.

Re: Mark Folders containing files, not only Subfolders

PostPosted: Mon Mar 15, 2021 1:31 pm
by Sebaster
Cool! Thank you!