Page 1 of 1

How to Implement An If - Else Rule

PostPosted: Sat Aug 29, 2020 8:18 pm
by sourcecodemage
I recently 2 rules in Hazel on my Downloads folder that implement:

Rule #1 If image file is older than 1 day and in photo library, move to Trash folder.
Rule #2 If image file is older than 1 day, import into Photos and move to backup images library folder on NAS.

What this solves is sometimes I might download the same image more than once, and Hazel will try to import it into Photos, which then opens a prompt window asking what I want to do with the file ( skip or import anyway ).

That will no longer happen. Great.

However, I noticed in the Hazel logs this message. which is expected.
File xyz moved out of folder. No longer tracking.


But then it looks like it still tries to process the file against rule #2
Error resolving symlinks for path /path/to/xyz:, No such file or directory


This is a debug issue, to probably no big deal. If I can squelch it by somehow telling Hazel "if rule #1 matched, to process the file with #2 ( or any other rule, for that matter ).

Is there a way to do this?

Re: How to Implement An If - Else Rule

PostPosted: Mon Aug 31, 2020 10:38 am
by Mr_Noodle
You can use the Continue action in the first rule though not sure how both rules can be run if they both move the file to different places.

Re: How to Implement An If - Else Rule

PostPosted: Mon Aug 31, 2020 1:00 pm
by sourcecodemage
Mr_Noodle wrote:You can use the Continue action in the first rule though not sure how both rules can be run if they both move the file to different places.

The rule have inverse conditions, eg if x == 1 do this, if x !=1 do something else.