Page 1 of 1

Various conditions, but always same action

PostPosted: 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.)

Re: Various conditions, but always same action

PostPosted: Sun Nov 17, 2013 1:17 pm
by a_freyer
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.

Re: Various conditions, but always same action

PostPosted: Sun Nov 17, 2013 1:34 pm
by mkalina
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.

Re: Various conditions, but always same action

PostPosted: Sun Nov 17, 2013 2:40 pm
by a_freyer
Id only have one rule