Page 1 of 1

Deleting folders after moving files from them

PostPosted: Wed Aug 23, 2017 11:42 am
by jamjam
Let's say I have this file structure, where names the number of subfolders is random.

Monitored Folder
- Folder1
- - Subfolder1
- - - File1
- Folder2
- - Subfolder2
- - - Subfolder3
- - - - File2

I want to move certain files to the monitored folder, and then delete the folders. I've set up my rules like this:

1. Reorganize
If kind is Folder
Name doesn't contain /folders I want to keep intact/
- run rules on folder content

2. Move files
If kind is /needed files/
- move to monitored folder

3. Delete folders
If kind is Folder
Name doesn't contain /folders I want to keep intact/
- move to trash

But Hazel moves the folders to trash before the needed files can be extracted. I've tried multiple solutions, but can't get it to work...

Re: Deleting folders after moving files from them

PostPosted: Thu Aug 24, 2017 10:17 am
by Mr_Noodle
With that rule ordering, I don't see how rule 3 ever kicks in as those folders will always match rule 1. What you should do is add a condition to rule 3 to identify when a folder is ready to be thrown away (like check its size or sub-file count). After doing that, move it above rule 1.