It' one simple rule to replace hundred's of rules. It works with the condition "If Contents contain match custom list item" and with the "Sort into subfoler with pattern xxxxxx" action.
Imagine you have hundreds of types of documents all in different formats. For example, it could be your bills for electricty, water, gas, telephone, WalMart, Insurance, Amazon, Apple, Wall Street Journal, and Doctor. That's just 10 types and every bill is in a different format, a different pattern. So you end up writing a different Hazel rule for each of the ten documents. You would probably have created a rule for each document something like this: "If contents contain match Amazon" do the following....
Here's how to write just one rule - to save yourself a ton of time:
The trick is to use "Contents Contain match Custom List item".
"Custom list item" lets you put in multiple parameters and pass them to a token which can be used later to re-name the file and move the file to a folder with the same name.
Here's how it looks - ( I decided to call my token "invoicer".):
![Image](https://i.imgur.com/XKK5h1n.png)
When you done this, hover your mouse over the token name (invoicer in this case), and the little "Down-arrow" will appear. Click on it and you will get a screen like the one below. Click on the plus key (+) to add as many names to your list as you want.
![Image](https://i.imgur.com/IA2GrNp.png)
After entering all the company names that I deal with, I can finish the rule which looks like this.
![Image](https://i.imgur.com/4dxw976.png)
This rule will read each document, find the name of the supplier (called "invoicer") and rename the file with the name of the of the invoicer and automatically file it in a folder (newly created with the invoicer's name, if the folder does not already exist).
You don't have to use simple names if there is a risk that word might be in another type of document. Instead you can choose a very unique word, such as the account number, or phone number of the company, and then replace it as shown in the picture below. My unique account number with Amazon is 1234567. But I don't want to call my file "1234567.pdf" nor do I want it filed in a folder called "1234567". Below, I show you how to replace the +"1234567" with the word "Amazon"
![Image](https://i.imgur.com/wFVlxCe.png)