Various conditions, but always same action

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

Moderator: Mr_Noodle

Various conditions, but always same action Sat Nov 16, 2013 10:55 am • by mkalina
I have several conditions that have to be met considering specific files in my downloads-folder. These conditions check for specific filenames, dates, patterns, etc. - all in all, I have more than 25 rules set up to match these files.

All of these 25 conditions, if matched, do the same: The file is copied into a disk image that has to be mounted before the file is copied into it.

Currently I have copied and pasted my "mount disk image"-script 25 times into my Hazel rules. With every new rule, I need to copy the whole thing again.

Is there a way to have Hazel do some specific set of actions when a rule is matched? (I am talking about something like a set of rules named "A" that has to be executed when conditions 1, 2, 3...23, 24 or 25 are met.)
mkalina
 
Posts: 11
Joined: Sat Nov 16, 2013 10:48 am

A single rule is the solution to your problems. Just change (all) to (any) in your condition.

On the other hand, if you do have multiple conditions for each rule (e.g., name is "test" AND extension is "test" then you can hold OPT to create nested conditions.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

And how would you deal with such a construction:

Condition 1-5
Rule A
Rule B
Rule C

Rules A and C are always the same (eg mounting and unmounting a volume), whereas Rule B changes.
mkalina
 
Posts: 11
Joined: Sat Nov 16, 2013 10:48 am

Id only have one rule
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado


Return to Support