Subfolders specific files deletion

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

Moderator: Mr_Noodle

Subfolders specific files deletion 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.
Chris Bernard
 
Posts: 10
Joined: Fri Jan 04, 2019 4:23 am

Re: Subfolders specific files deletion 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.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolders specific files deletion 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.
Chris Bernard
 
Posts: 10
Joined: Fri Jan 04, 2019 4:23 am

Re: Subfolders specific files deletion 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/
"Behind all the inhuman aspects of automation (...) its real possibilities appear: the genesis of a technological world in which man can finally withdraw from (...) the apparatus of his labor – in order to experiment freely with it." /Marcuse
Robert
 
Posts: 52
Joined: Sun Dec 16, 2018 8:05 am

Re: Subfolders specific files deletion Wed Apr 10, 2019 10:38 pm • by Chris Bernard
Thanks a lot, Robert.
Chris Bernard
 
Posts: 10
Joined: Fri Jan 04, 2019 4:23 am

Re: Subfolders specific files deletion 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.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Subfolders specific files deletion Thu Apr 11, 2019 10:27 am • by Chris Bernard
OK, many thanks.
I must study that deeper.
Chris Bernard
 
Posts: 10
Joined: Fri Jan 04, 2019 4:23 am


Return to Support