Deleting folders after moving files from them

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

Moderator: Mr_Noodle

Deleting folders after moving files from them 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...
jamjam
 
Posts: 1
Joined: Wed Aug 23, 2017 11:33 am

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.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support