Hazel is not processing rules in the correct order

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

Moderator: Mr_Noodle

I have two rules involving the renaming of zip files in downloads which are interdependent. One needs to be applied before the other for it to work the way I want.

Since Hazel is supposed to be match rules in order I set it up like this:

(1) Unzip src to Source
(2) Unzip aud to Source->Audio (added *below* (1) in the rules list)

The first rule creates an unzipped folder and the second rule adds its unzipped contents as a subfolder to the Source folder created from Rule #1.
I've tested this by pausing Hazel, adding the two zip files to Downloads, then restarting Hazel.

However, it doesn't work in the right way - Rule 2 fires first, so when Rule 1 executes it ends up creating a folder called Source-1. This is confirmed by the logs.. somehow Hazel matches aud.zip in Rule 2 before src.zip is matched in Rule 1.

Does anyone have any advice for what is going on here? Why doesn't Hazel process these rules in order?
hazlitt
 
Posts: 3
Joined: Mon Feb 16, 2015 7:54 am

Can you post screenshots of your rules? Also, use the preview feature (the "eye" button) to check your matches.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi,

I can show the rules. I've had to modify Rule 2 to cope with the fact that it is currently being matched first but it still illustrates the problem. Rule 1 is above Rule 2, both rules are matched successfully but Rule 2 will fire first unless I alter the rule (like I have done) to ensure the mp3 zip file is not processed first ('if not added in the last 5 minutes' is my curent workaround - both files arrive at the exact same time in Downloads).

Rule 1 (text-based zip)
Image

Rule 2 (mp3 zip)
Image

Rule Order in Downloads
Image

Matching of Rule 1 in Downloads
Image

Matching of Rule 2
Image
hazlitt
 
Posts: 3
Joined: Mon Feb 16, 2015 7:54 am

It's not clear to me how rule 1 can fire first here. You would need to provide logs showing this. Note that by default, only one rule gets executed per file. So rule 2 should never fire if rule 1 matches. To change that, you would need to add the Continue action to any relevant rules where you want Hazel to continue processing rules even if that rule matched.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Maybe I wasn't making it clear.

Rule 1 fires for one file (text.zip) and Rule 2 fires for another (cd.zip). Does this explain why Rule 2 can fire first?

Thanks,
hazlitt
 
Posts: 3
Joined: Mon Feb 16, 2015 7:54 am

I'm still not following. Those two rules seem to operate on different things and I'm not quite seeing what you are expecting and what is going wrong. Can you show a step-by-step example showing going through the flow. Show the names of the files at each step. Indicate (a) what you expect to happen and (b) what is happening.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support