Page 1 of 1

Hazel is not processing rules in the correct order

PostPosted: Mon Feb 16, 2015 1:06 pm
by hazlitt
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?

Re: Hazel is not processing rules in the correct order

PostPosted: Mon Feb 16, 2015 3:05 pm
by Mr_Noodle
Can you post screenshots of your rules? Also, use the preview feature (the "eye" button) to check your matches.

Re: Hazel is not processing rules in the correct order

PostPosted: Tue Feb 17, 2015 8:38 am
by hazlitt
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

Re: Hazel is not processing rules in the correct order

PostPosted: Tue Feb 17, 2015 12:29 pm
by Mr_Noodle
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.

Re: Hazel is not processing rules in the correct order

PostPosted: Thu Feb 19, 2015 6:56 pm
by hazlitt
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,

Re: Hazel is not processing rules in the correct order

PostPosted: Fri Feb 20, 2015 1:42 pm
by Mr_Noodle
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.