Page 1 of 1

Do stuff to a folder based on contents

PostPosted: Fri Jan 15, 2016 12:11 am
by MacMatt
I can get rules to work on a folder, and I can get it to go into a folder and sub folders, but one thing I get stuck on is saying:

Delete this folder, unless it has a movie in it.

I see that you can't mix and match folder and file rules, (which would solve my problem)

...so what is the best way of saying:

Delete this folder, unless kind inside is movie.

Do I need two rules to do this?

Re: Do stuff to a folder based on contents

PostPosted: Fri Jan 15, 2016 11:34 am
by Mr_Noodle
That is a bit different. You want to move a folder based on its contents. To do that, hold down option while clicking the + button to create a new nested condition. There, you will see a new pop-up. There, you can set that to "any/all of it's sub-files". Any conditions under that nested condition will now apply to the items under that folder. So, you can add something like:
Code: Select all
    If (none) are met for (all of its sub-files...)
        Kind is Movie

That will match a folder if none of its subfiles are movies.

Re: Do stuff to a folder based on contents

PostPosted: Fri Jan 15, 2016 6:51 pm
by MacMatt
Ah I'm so used to matching conditions using all or any I never thought to use if none of these conditions are true!

Cool I will give that a crack. Thanks.

Re: Do stuff to a folder based on contents

PostPosted: Fri Jan 15, 2016 6:59 pm
by MacMatt
Mr_Noodle wrote:That is a bit different. You want to move a folder based on its contents. To do that, hold down option while clicking the + button to create a new nested condition. There, you will see a new pop-up. There, you can set that to "any/all of it's sub-files". Any conditions under that nested condition will now apply to the items under that folder. So, you can add something like:
Code: Select all
    If (none) are met for (all of its sub-files...)
        Kind is Movie

That will match a folder if none of its subfiles are movies.



So like this? This is hopefully to tell Hazel to turf the folder and any left over .nfo or srt files out, after the movie has been moved to another location. So If there's less than 4 files, if there's less than 100mb and if there are no movies move this folder to the trash...

Is this the structure?

Image

Re: Do stuff to a folder based on contents

PostPosted: Mon Jan 18, 2016 12:02 pm
by Mr_Noodle
You have "none for any of its sub-files", which means you just need one file to not meet that condition for that to match. You want to use "all sub-files" to make sure that none of the files meet that condition.