Feedback needed on multiple rules on the same file

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

I posted a question this morning asking how to run multiple rules.
Essentially I have a holding folder for PDFs prior to filing them. I created a number of rules which set tags based on content thinking the the rules in a particular folder were iterative. The rules were set up as follows,

If contents contains DVLA set tags DVLA, CAR
If contents contains BMW set tags CAR, BMW
If contents contains Volvo set tags CAR, VOLVO
Etc.

I noticed the problem when I scanned a letter from the DVLA regarding the BMW. I had expected the first two rules to be triggered setting the tags to DVLA, CAR and BMW. What actually happened is that only the first rule triggered and only DVLA and CAR was set.

Whilst I could try and nest conditions, I need 20+ tagging rules which are applied cumulatively.

I trust this adequately explains my use case but I'm happy to provide more information.

Dave
Fatlab
 
Posts: 3
Joined: Fri May 16, 2014 4:25 am

Please answer the questions in the original post as that will go a long ways towards this feature happening.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

In response to your specific questions;

1. Please provide a concrete example of how you would use this. If you cannot provide this, then please do not continue.

Essentially I have a holding folder for PDFs prior to filing them. I created a number of rules which set tags based on content thinking the the rules in a particular folder were iterative/cumulative. The rules were set up as follows,

Rule A: If contents contains DVLA set tags DVLA, CAR
Rule B: If contents contains BMW set tags CAR, BMW
Rule C: If contents contains Volvo set tags CAR, VOLVO
Etc.

I noticed the problem when I scanned a letter as a PDF into the holding folder. It was from the DVLA regarding the BMW. I had expected the first two rules to be triggered setting the tags to DVLA, CAR and BMW. What actually happened is that only the first rule triggered and only DVLA and CAR was set.

Whilst I could try and nest conditions, I need 20+ tagging rules which are applied cumulatively.


2. Hazel currently will re-run rules on a file if the rule it matches changes. So if Hazel matched rule A before and now matches rule B instead, rule B will get run. But if it keeps matching rule A as before, nothing will happen. With this in mind, apply the following scenario to the workflow you described in #1 above:

A file matches rules A, B, and C in that order.
Suppose it no longer matches A, but matches B and C. Do B and C get executed again? Yes although in my example B & C would effectively do nothing as the tags already existed from the first pass and the tag from A would still be in place. I had not envisioned a scenario in my use case where the content of a processed file would change causing a previously triggered rule to no longer be relevant so I would not expect the applied tags from rule A to be removed.
Suppose it no longer matches B? Does A get executed again? How about C? Yes (same principle as above)
Suppose it now matches rule D after the others. Do A, B, and C get executed again before D? Yes (same principle as above)
Suppose it matches rule Z before rule A. Do A, B and C get executed again after Z? Yes (same principle as above)

My responses above are based on looking to use rules to make changes which do not manipulate the file/directory structure. Ideally I'd appreciate the ability to flag a rule as being individual (execute and go no further like what happens now) or cumulative (execute and process the next rule). That way an order of presidence could be maintained with the ability to execute multiple steps where required. Similarly the ability to flag a rule as 'execute once only' could get round the problem of rules which physically change the state of a file or structure. For example in my scenario above the rule 'contains DVLA' could be set to send me an email but if it was flagged to only execute once it would prevent multiple triggers.

3. Are you willing to accept numerous side effects of this feature? For example, if rule A moves the file outside the folder, certain pieces of metadata may not make sense anymore (folder level) or just won't work because of implementation details ("is among") for any subsequent rules. Yes
Fatlab
 
Posts: 3
Joined: Fri May 16, 2014 4:25 am

I have a situation where I am using Hazel Rules in conjunction with OmniOrganiser's syncing facility, (through their cloud based app OmniPresence) whereby any Omni documents placed in a folder will be synced with my iPad. I want Hazel to inform if the said documents have not been opened within a specific timeframe, e.g. In the last month. The problem is that only the first document will be notified because of this restriction as all the documents are in the same folder and only the first rule will be actioned, and I can not have multi syncing folders! As I read your proposal this would enable me to achieve what I want to do.
Allsop
 
Posts: 67
Joined: Thu May 01, 2014 1:43 am

I like the idea of an action at the bottom of every rule to either continue processing additional rules or to stop processing additional rules. The default could be the current method of stop processing additional rules.

This is my use case:
I am a network engineer and I collect lots of PDF files about the technology I work with. I tag them with keywords for those different technologies. However Document A can have tags 1, 2, 3, and 4, but Document B can have tags 1, 4, 5, 6, and 7. To write rules to match each use case is simply not possible. Right now I have over 1100 different tags.

In order to overcome the current limitation I have a root tagging folder and created separate sub-folders for each tag. There are two rules for each sub-folder, one that matches the contents, adds the tag(s), and then moves it to the next sub-folder to process & the other if it doesn't match to move it to the next sub-folder to process.

To add just 1 additional tag in this process I have to 1) create a new sub-folder, 2) modify the two Hazel rules for the last sub-folder to move the files to this new sub-folder to process, 3) create a rule to match, tag, and move to a finished folder, and 4) create a rule if it doesn't match to move it to the finished folder.

If there was an action to continue processing additional rules I would 1) modify the last rule to continue processing and 2) create the new rule.
twidfeki
 
Posts: 1
Joined: Sat Jun 28, 2014 10:48 am

Previous

Return to Open Discussion