Contents contain match from a list

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

Moderator: Mr_Noodle

Contents contain match from a list Fri Mar 24, 2017 1:46 pm • by swkent
I have 4 very large folders of exported text messages in both csv and pdf format. In the folders I am looking for files containing a name from a list of about 70. I'm trying to avoid creating a massive rule that has 70 Contents contain match conditions (typing each name twice is not appealing).

I would like to be able to search for the name and if found, add the name matched as a suffix and move it into a subfolder. Is it possible to do a contents contain match condition with more than 1 possible matching criteria? If not, is there a way to script it?

Thanks,

SK
swkent
 
Posts: 2
Joined: Wed Nov 28, 2012 5:37 pm

Re: Contents contain match from a list Mon Mar 27, 2017 10:42 am • by Mr_Noodle
The only way to do this is with a script at the moment.

I've thought about different ways to have Hazel read in or maintain a list or table. For future consideration, would you want this list editable and maintained within Hazel itself or do you prefer that it be maintained in an external file? If the latter, what is the format of this file?
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents contain match from a list Thu Apr 06, 2017 4:11 pm • by printerless
Very good proposal!

Here is an implementation idea:
https://www.filejuggler.com/beta/#wordlist-and-dictionary

FileJuggler is a Hazel-like approach under Windows.
printerless
 
Posts: 4
Joined: Thu Apr 06, 2017 2:14 pm

Re: Contents contain match from a list Fri Apr 07, 2017 10:57 am • by Mr_Noodle
Thanks for the link. It seems similar to what I've been mulling over. Nonetheless, something that is under consideration for some time in the future.
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents contain match from a list Tue Apr 25, 2017 2:41 pm • by marckoran
Mr_Noodle wrote:Thanks for the link. It seems similar to what I've been mulling over. Nonetheless, something that is under consideration for some time in the future.


I have just downloaded Hazel and I am getting used to it. Very good.
I am planning to use it to automatically file OCR'd documents into specific folders.
The majority of the time, I simply use the unique account number of the invoice in question, and send it to a specific folder.
In other words, I do the same thing over and over again.

The most basic CSV File would have:
Account Number
Destination Folder
These essentially are:
Content
Move To

I am likely to have 100 or so instructions, and it would be MUCH easier for me to have them in a CSV File, rather than have to click and key in the information in a variety of places. So, at the moment, I am manually entering the same type of instruction over and over again.

(I was hoping that I could export the rules into a text-editable file (XML?) that I could edit as well, but no such luck.)

I guess I would need to write some kind a script in order to do what I want, but my goal with Hazel i to get away from coding :)

So, as a "new user", I am happy with what I have, but I know that data entry will become tedious, arduous, and mistake-prone.

Here are my suggestions:
a) Have a CSV file (or other text file) to be able to load a massive amount of instructions/rules.
b) Permit relative folders, rather than absolute folders. (I just threw this one in, since I am unsure how I can port my instructions to another folder. I test everything in a test folder, then I want to move to a "production folder")

Anyways, I know I sidetracked with product feedback, but my main point would be getting contents and or rules from a text editable list.
marckoran
 
Posts: 5
Joined: Tue Apr 25, 2017 2:31 pm

Re: Contents contain match from a list Wed Apr 26, 2017 10:14 am • by Mr_Noodle
Thanks for the input. As far as relative folders, you can do that with Sort into subfolder.
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents contain match from a list Wed Apr 26, 2017 11:27 am • by marckoran
Mr_Noodle wrote:Thanks for the input. As far as relative folders, you can do that with Sort into subfolder.

Yes, I know that is a way to do it, and that is fine, but that simply allows relative subfolders, as opposed to folders at the same level. Is that correct?

Is there a way to get a "sister folder" rather than a "child folder"?
marckoran
 
Posts: 5
Joined: Tue Apr 25, 2017 2:31 pm

Re: Contents contain match from a list Thu Apr 27, 2017 10:37 am • by Mr_Noodle
You can move the item up one level (use "enclosing folder") and then Sort from there.
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents contain match from a list Tue Sep 19, 2017 9:59 am • by marckoran
Update:
I have over 200 rules to process each of my documents (who knew!). They are maintained in Excel.
I use Keyboard Maestro to load them into Hazel. Basically, a macros that points and clicks and types into the Hazel interface.

Why Excel file has the following fields:
1 RuleName
2 EnabledFlag
3 Business
4 File Type
5 ContainsString1
6 ContainsString2
7 ContainsString3
8 FilenameContainsString1
9 FilenameContainsString2
10 Action1
11 Action1Data
12 Action2
13 Action2Data
14 Folder
15 Subfolder
16 Subsubfolder
17 Future4
18 Future5

Advantages:
1) Using lookups between tables (tabs) in Excel, I can treat the same kind of file the same way for every business I run.
2) I can see all of my rules at once.
3) I can load a whole bunch of rules with the same basic premise. (Find a string, and sort it into a subfolder).

Problems:
1) Using a Macro software to program Hazel is not ideal at all;
a) It is brittle, crashing or hanging at times.
b) If I want to change my set of rules, I need to reload all 200, and each ones takes at least 30 seconds. (I guess I could be faster.)
c) If Hazel had a bulk-upload feature, none of this would be necessary.
d) A Table-based file like Excel or CSV does not represent the data model that Hazel does. Ideally, it is more of an XML model, with Nesting. However, modifying data in a table is much easier when doing the same thing over and over again.
- This can be solved by having "column pairs", where the first column name (in the first row) is the "thing", and the second is the value. For example, the following columns titles could exist:
*RuleTitle
*Condition1
*Condition1Value
*Condition2
*Condition2Value
*Action1
*Action1Value
- In this case, the column titles themselves need to be parsed by Hazel before loading up the rule. Of course, this whole mechanism is brittle and prone to error, and users may get frustrated when learning it. However, this could be offset by creating an "export" command whereby a file is exported from a current rule, and then a user is free to add more rows there...
- I have over-simplified my example, leaving "options" and "all/any" conditions out, but you get the point...

Suggestion for User Interface:
- When right-clicking on a "Rule", offer an "export to hazel.csv" button (or create bulk load file from this rule).
- To the right of the pencil Icon, add an Icon to "Bulk Load from CSV"

If I had those two options, I could get rid of my Keyboard Maestro hack and really feel free to modify not only my rules but my rule templates!

Thanks for your consideration.
marckoran
 
Posts: 5
Joined: Tue Apr 25, 2017 2:31 pm

Re: Contents contain match from a list Tue Sep 19, 2017 10:23 am • by Mr_Noodle
My idea for tables is not so you can create a bunch of rules. Instead, it would eliminate them all hopefully replacing them with one.

For instance, if you have a rule checking if a document contains "some text", then rename it "some other text", then having a table will allow you to link those things. You would replace "some text" with something like "column A from table X" and "some other text" with "column B from table X".
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents contain match from a list Tue Sep 26, 2017 9:27 am • by marckoran
Yes, that is also a good idea. It would have the advantage of easily being run, and the user can edit it outside of Hazel. On the other hand, it would lose the ability to "test" a file out, which is a big advantage of your user interface. How would I know if a file meets the conditions of one more rows? And which one? And which order?

If you use the table to import/export rules, then the end user is able to see the net effect of the rules, test files against individual rules, and even modify/tweak them after uploading. Admittedly, this causes some user interface challenges and is problematic when a user is debugging. And when a single rule is changed, it is not longer like the others... So that is also tough to deal with.

I look forward to whatever you decide on and will be an ardent tester. Like I said, I have 200 rules (and growing), and it has become beast :)
marckoran
 
Posts: 5
Joined: Tue Apr 25, 2017 2:31 pm

Re: Contents contain match from a list Sat Oct 13, 2018 1:24 am • by jamwithtoast
marckoran wrote:Update:
I have over 200 rules to process each of my documents (who knew!). They are maintained in Excel.


Hi Marckoran, this is actually pretty cool. I have quite a few rules myself and it is painful to manage sometimes. Sure I could be extremely clever and combine some of them, however spent too much time messing around with Hazel rather than getting the real work done.

Would would you be open to sharing the template and KB file?

It would be good to have the configuration in XML or something that one could script and insert...
jamwithtoast
 
Posts: 9
Joined: Tue Sep 12, 2017 9:22 am

Re: Contents contain match from a list Fri Jun 28, 2019 8:40 am • by marckoran
So, here I am 2 years later, and I have 370 rules, which I maintain in Excel, and I have a Keyboard Maestro macro to try to insert them into Hazel. The solution is very brittle.

Now, I have hired an Executive Assistant (my business is growing and I no longer have the time), and I cannot train her to do it this way.

So, I am back at the drawing board. Been researching all kinds of solutions and hired a developer to create an AppleScript as well. This solution will not have a great UI, but it will work. My EA will have to learn how to use that, but that will be ok.

Mr Noodle! You said you would think about some kind of solution for this. Do you have an update for me?

(I will not be leaving Hazel entirely, but once I start writing my own scripts, I will have less and less need for it. I don't like a mishmash of solutions and will eventually have scripts to do it all for me.)

Let me know! (Always a fan, but reaching the limits of Hazel...)
marckoran
 
Posts: 5
Joined: Tue Apr 25, 2017 2:31 pm

Re: Contents contain match from a list Fri Jun 28, 2019 11:29 am • by Mr_Noodle
I am working on table support for Hazel 5 though I don't anticipate it coming out until next year, hopefully on the earlier side.
Mr_Noodle
Site Admin
 
Posts: 8697
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Contents contain match from a list Fri Sep 06, 2019 12:04 pm • by venudhar
Hello, I am looking for a solution this issue. Has this been made possible? Can you please share and support? thanks.


marckoran wrote:
Mr_Noodle wrote:Thanks for the link. It seems similar to what I've been mulling over. Nonetheless, something that is under consideration for some time in the future.


I have just downloaded Hazel and I am getting used to it. Very good.
I am planning to use it to automatically file OCR'd documents into specific folders.
The majority of the time, I simply use the unique account number of the invoice in question, and send it to a specific folder.
In other words, I do the same thing over and over again.

The most basic CSV File would have:
Account Number
Destination Folder
These essentially are:
Content
Move To

I am likely to have 100 or so instructions, and it would be MUCH easier for me to have them in a CSV File, rather than have to click and key in the information in a variety of places. So, at the moment, I am manually entering the same type of instruction over and over again.

(I was hoping that I could export the rules into a text-editable file (XML?) that I could edit as well, but no such luck.)

I guess I would need to write some kind a script in order to do what I want, but my goal with Hazel i to get away from coding :)

So, as a "new user", I am happy with what I have, but I know that data entry will become tedious, arduous, and mistake-prone.

Here are my suggestions:
a) Have a CSV file (or other text file) to be able to load a massive amount of instructions/rules.
b) Permit relative folders, rather than absolute folders. (I just threw this one in, since I am unsure how I can port my instructions to another folder. I test everything in a test folder, then I want to move to a "production folder")

Anyways, I know I sidetracked with product feedback, but my main point would be getting contents and or rules from a text editable list.
venudhar
 
Posts: 2
Joined: Fri Sep 06, 2019 12:00 pm


Return to Support

cron