How to Implement An If - Else Rule

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

Moderator: Mr_Noodle

How to Implement An If - Else Rule Sat Aug 29, 2020 8:18 pm • by ikomrad
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?
ikomrad
 
Posts: 15
Joined: Sat Nov 07, 2015 11:42 pm
Location: Denver,co

Re: How to Implement An If - Else Rule 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.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How to Implement An If - Else Rule Mon Aug 31, 2020 1:00 pm • by ikomrad
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.
ikomrad
 
Posts: 15
Joined: Sat Nov 07, 2015 11:42 pm
Location: Denver,co


Return to Support

cron