Is there a simpler way?

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

Moderator: Mr_Noodle

Is there a simpler way? Wed Feb 21, 2018 7:26 pm • by jormsby
I am just wondering if there is simpler way to handle some of my Hazel rules. As an example, I have three rules related to my car insurance, one for each car in the family. They are identical with the one exception being they each looks for a different car 'type' in the scanned file and will rename the file according to the car 'type' and move the file to the appropriately named folder.

Is there maybe a more efficient way to do this in one rule? Or is this one of those times I should adhere to the KISS principle. :roll:
jormsby
 
Posts: 27
Joined: Mon Oct 13, 2014 7:04 pm

Re: Is there a simpler way? Thu Feb 22, 2018 11:23 am • by Mr_Noodle
You can try combining them into a single rule with multiple conditions. Look up "nested conditions" in the help. You can use those to create a set of "any" conditions under the "all" one. Also, you can re-use custom attributes in each of the conditions so that you only have one attribute to use in the renaming step.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Is there a simpler way? Mon Feb 26, 2018 3:48 pm • by jormsby
AHH HAA!! :idea:

Finally get it. I had read both the nested and custom attribute sections multiple times and understood how to test for different conditions but did not understand how to use the 'found' condition in an action.

I understood that you could have an "if any" condition with multiple custom texts items called •Name and assign it a pattern like 1111, or abc, or a1% and that if that pattern was found, then •Name would become that found pattern. However, for some reason I did not realize that you could 'force' what •Name would be based on putting in literal text, kind of like an If/Then statement.

Like:
If any
-File Contains •Name (where •Name was assigned 'Fred')
-File Contains •Name (where •Name was assigned 'Nancy')
-File Contains •Name (where •Name was assigned 'George')

And that when using •Name for renaming a file, it would be which ever of the three matched. I guess I was thinking that the 'pattern' matches were variables selected by Hazel and that the literal names were 'constants' chosen by me and they would some how behave differently.

Anyway, finally figured this one out. This will help me reduce my Rules by almost 1/3.

Thanks again.
jormsby
 
Posts: 27
Joined: Mon Oct 13, 2014 7:04 pm


Return to Support