Page 1 of 1

Subfolders specific files deletion

PostPosted: Wed Apr 10, 2019 7:29 am
by Chris Bernard
Hello

I would like to delete specific files in subfolders.

In details:
I have a Folder F, containing X subfolders.
If a subfolder contains a file named "xxx", I would like to delete it.


Is there a way to perform it in Hazel, or should I add an AppleScript ?
Thanks in advance for your help.

Re: Subfolders specific files deletion

PostPosted: Wed Apr 10, 2019 10:12 am
by Mr_Noodle
If you want to delete the files (not the folders containing them), then you need to set up a subfolder rule in addition to a rule to delete the file. Search the help for "subfolders" as there's a chapter dedicated to this.

Re: Subfolders specific files deletion

PostPosted: Wed Apr 10, 2019 12:34 pm
by Chris Bernard
Thanks a lot for quick replying.

2 questions:
1- Is it possible to set a rule WITHOUT knowing the variable number of subfolders, which is my case ?
2- Where is the subfolder help ? I did not find it. Sorry.

Re: Subfolders specific files deletion

PostPosted: Wed Apr 10, 2019 2:43 pm
by Robert
1. Yes. Hazel automatically searches all subfolders. No matter how many there are.
2. There you go: https://www.noodlesoft.com/manual/hazel ... ubfolders/

Re: Subfolders specific files deletion

PostPosted: Wed Apr 10, 2019 10:38 pm
by Chris Bernard
Thanks a lot, Robert.

Re: Subfolders specific files deletion

PostPosted: Thu Apr 11, 2019 10:22 am
by Mr_Noodle
To clarify, Hazel does not automatically search subfolders. You do need to add a rule. While that rule will go into all subfolders, you can also write a rule which only goes into particular subfolders or only subfolders to a certain depth.

Re: Subfolders specific files deletion

PostPosted: Thu Apr 11, 2019 10:27 am
by Chris Bernard
OK, many thanks.
I must study that deeper.