Trouble getting Go into subfolder to work

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

Moderator: Mr_Noodle

Trouble getting Go into subfolder to work Mon Nov 24, 2025 4:09 am • by andy_vdg
Hi everyone,

I’m building an automated photo-processing workflow with Hazel, but I’ve run into a structural limitation, and I’d like to confirm whether there’s a clean, supported way to solve it.

I have one monitored folder: /Pictures/

Rule 1:
Detects new image files (jpg, heic)
Sorts into subfolder with pattern Pictures [date created (yyyy)]>[date created (yyyy-mm-dd)]
resulting in a new folder with the images in it e.g. /Pictures/Pictures 2025/2025-01-01

This folder does not exist before Hazel creates it.
After the folder is created and files are placed into it, I want...

Rule 2: to run a shell script, but on the new folder itself, not on the individual images.
That script performs recursive date-fixing and renaming inside the subfolder.

The challenge I have here is that Rule 1 fires for each new image, but I want Rule 2 to only fire once for the new folder. I also would like to avoid having to monitor each year's folder individually as that becomes unwieldy pretty quickly.

I have added a Go into subfolder rule between Rule 1 and Rule 2 containing the "Run rules on folder contents" action, as described in the documentation. But I cannot seem to get it to do what I want. It either processes every single sub-folder (thousands over decades of pictures) and locks up hazelworker for hours, or I set the rules too tight, and it doesn't do anything.

Is there a way to trigger my Rule 2 on the newly created sub-folder?
Thanks in advance for your help.
andy_vdg
 
Posts: 11
Joined: Sat Dec 27, 2014 6:45 pm

Re: Trouble getting Go into subfolder to work Mon Nov 24, 2025 11:10 am • by Mr_Noodle
If you want to script to run on the newly created folder, then you do not want to go into subfolders.

Instead have a rule match the folder instead of images.

Also, the troubleshooting guide should help with visualizing how the rules are working: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/
Mr_Noodle
Site Admin
 
Posts: 12098
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Trouble getting Go into subfolder to work Mon Nov 24, 2025 12:36 pm • by andy_vdg
It sounds so simple and yet I must be overthinking this or just made a dumb mistake somewhere.
I removed the subfolder step and now only have two rules...
Rule 1 checks for images and sorts them into subfolders
Rule 2 checks for folders and I tell it to look subfolder depth 1 or 2

Preview always shows everything green which is why I am stumped.

I turned on debug and get this log line:

2025-11-24 17:34:03.816 86Z3GCJ4MF.com.noodlesoft.HazelHelper[30059] DEBUG: Ignoring event in directory /Volumes/media/Pictures/Pictures 2021/2021-01-31. Only need to check for changes 1 levels deep. Event is in directory 2 levels deep.
andy_vdg
 
Posts: 11
Joined: Sat Dec 27, 2014 6:45 pm

Ok - I cannot figure this out.
How do I match a folder that is two levels deep?
Pictures <-- gets scanned matches no rules
- Pictures 2025 <-- Level 1
-- 2025-01-01 <-- Level 2 - shows up in logs but is always ignored.
andy_vdg
 
Posts: 11
Joined: Sat Dec 27, 2014 6:45 pm

Re: Trouble getting Go into subfolder to work Wed Nov 26, 2025 10:05 am • by Mr_Noodle
I thought you wanted to process the new folder at the top level ("Pictures 2025"). Is that not the case?
Mr_Noodle
Site Admin
 
Posts: 12098
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:I thought you wanted to process the new folder at the top level ("Pictures 2025"). Is that not the case?

Yes rule one works fine:
Rule 1:
Detects new image files (jpg, heic) in the monitored folder.
Sorts into subfolder with pattern Pictures [date created (yyyy)]>[date created (yyyy-mm-dd)]
resulting in a new folder with the images in it e.g. /Pictures/Pictures 2025/2025-01-01
Image

But Rule 2 never works. It is supposed to take the newly created folder two levels deep and call a script.
Pictures <-- monitored
-- Pictures 2025
---- 2025-01-01 <-- created but two levels deep.

Rule 2: to run a shell script, but on the new folder itself, not on the individual images.
That script performs recursive date-fixing and renaming inside the subfolder.
Image

The only way I can get it to work is to monitor each of those year folders individually and put Rule 2 in there.
Kind of wanted to avoid that, as I now have to monitor dozens of folders with the exact same rule duplicated dozens of times. So each small tweak to the rule now means going through and updating it dozens of times. I was hoping there was an easier way - especially because I can see in the debug logs that the new folder is evaluated but discarded... I was hoping the Subfolder Depth condition would tell it to do something with it.
andy_vdg
 
Posts: 11
Joined: Sat Dec 27, 2014 6:45 pm

So that monitoring of each folder individually is also not viable. It just makes my NAS grind to a halt because now all these hazelworkers are traversing all of the destination directories...
andy_vdg
 
Posts: 11
Joined: Sat Dec 27, 2014 6:45 pm

Re: Trouble getting Go into subfolder to work Fri Nov 28, 2025 10:55 am • by Mr_Noodle
If the script is recursive, does it matter whether it matches the folder at the top level as opposed to the subfolder inside it?
Mr_Noodle
Site Admin
 
Posts: 12098
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Trouble getting Go into subfolder to work Mon Dec 01, 2025 11:49 am • by andy_vdg
Thanks, that’s a good question. In my case it does matter. The script can run recursively but that is very expensive to do. It then traverses all folders within "Pictures 2025" when all I want it to do, is traverse the newly created folder. The recursive name is a bit of a misnomer as it just is the entry point for the script and handles Hazel sending multiple requests in short succession. It can also run recursivley if I tell it to so I can clean up old already sorted folders.
I'm a fan of not re-inventing the wheel so if I can find a way for Hazel to trigger my script on the most recently created subfolder even if it is two levels deep, I would do that. Otherwise I will consider just writing the sorting into the subfolders into the script itself.
The ideal behaviour is:
• Rule 1 creates /Pictures/Pictures YYYY/YYYY-MM-DD
• Hazel detects that newly created level-2 folder
• Rule 2 runs a script just once on that folder, and stops.

Hazel is detecting the folder (I see it in debug logs), but it ignores it as “2 levels deep” even though I set Subfolder Depth in the rule. That is why I was trying to match the level-2 folder directly.

If there’s a recommended pattern to match only the newly created level-2 folder without manually monitoring every year folder, that’s exactly what I’m trying to achieve.

Or is there a completely different way I am overseeing to achieve this?

Thanks again for your help.
andy_vdg
 
Posts: 11
Joined: Sat Dec 27, 2014 6:45 pm

Ok, I assumed "Pictures 2025" was the new folder.

So, yes, you would need a rule to tell Hazel to go into subfolders, as described in the chapter in the manual. To make things more efficient, you probably could add a condition to only do this at subfolder level 0 (the top level) so that it doesn't go deeper.

The rule to run the script would need to match folders at subfolder level 1.
Mr_Noodle
Site Admin
 
Posts: 12098
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support