Folder depths

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

Moderator: Mr_Noodle

Folder depths Thu Apr 15, 2021 5:52 am • by luoto
Hello.
I am not entirely clear what I need to do to obtain the following objective. I have looked around and fastened on https://www.noodlesoft.com/manual/hazel ... ubfolders/ but I am still unsure.

I have a series of folders that appear under a master directory that is monitored by Hazel (call it "monitor")

I have a current script/action (s) that does various processing and one of the actions is to delete the empty sub-directory (call it "sub1" for the example). That works. It has an "all" condition of kind=folder and sub-folder count is 0 (and if a match move to trash).

A change in a program creates a sub-directory within this existing nest, e.g. "/monitor/sub1/sub-directory."

The processing of the other actions (moving files) works.

Do I just need to change the sub-folder/count to 1 (?) to delete both /monitor/sub1 AND /monitor/sub1/sub-directory or do I need to do something else?

I am a bit concerned about doing a trial-and-error approach in the blind in case I kill data that is being added by other processes in the background. I couldn't find a separate reference. This viewtopic.php?f=4&t=470 suggests changing it to a "1" may work, but I'd rather get the collective expertise of someone more qualified than me to be sure.

Thank you in advance for any guidance.
luoto
 
Posts: 11
Joined: Thu Apr 18, 2019 3:54 am

Re: Folder depths Fri Apr 16, 2021 9:43 am • by Mr_Noodle
Instead of going off of count, you might want to use size instead. Also, it might be better to do this on a test folder so you can get things working as expected before using it on your real files.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Folder depths Sat Apr 17, 2021 5:09 am • by luoto
Mr_Noodle wrote:Instead of going off of count, you might want to use size instead. Also, it might be better to do this on a test folder so you can get things working as expected before using it on your real files.

Thank you. For some reason I never saw (or reacted to) the size function before! That did the job nicely.
luoto
 
Posts: 11
Joined: Thu Apr 18, 2019 3:54 am


Return to Support