Hazel Rule Examples

Thanks. Will give that a go.

What PDF software do you use?

You just need an OCR program that can be scripted, & set it to run on whatever gets added to a folder. I use OCRKit for this, with an always on Mac and Dropbox folder, so I can save a file from iOS and let the Mac do the OCR.

I am in charge of all of our household documents (family of 5 plus small biz), so I use Hazel like a maniac!

All my stuff starts in 1 of 2 folders:

  1. Dropbox folder called “docs-file”
  2. Downloads – a weigh station-- Hazel OCRs any PDFs via script using PDFPenPro app and then moves the files to “docs-file”
    I try to limit incoming to those. Most of my Hazel rules are in “docs-file” folder.

My stuff gets into those folders in a few ways:

  1. PDFs I take from the internet (useful for statements) – I have a shortcut key to get these into PDF format from Safari. I put this in the “downloads” folder so it gets OCR’d
  2. IFTTT rule that saves any attachments from my gmail to my “docs-file” folder. (Any email attachments from other email accounts gets forwarded to my gmail via Airmail Rules)
  3. Scansnap sends OCR’d paper files directly to “docs-file” folder

Some Hazel rules I use heavily:

  • Household files: statements, bills – the usual suspects that come in monthly. Hazel renames these and then files them to either folders on Dropbox or else directly into Devonthink group (via Applescript).

  • Photos - Hazel looks for extensions and automatically imports personal videos and photos into my Photos app repository.

  • Tags to OmniFocus – some files I need to act on get embedded into OmniFocus. I assign an “OmniMe”" tag, so Hazel sees the tag and embeds the file into a new OF task via applescript.

  • Other Tags: For shorter term projects I am working on, I assign a tag to move the document into that project’s folder. So I’ll have tags like “Christmas” or “2017 Taxes”. Hazel doesn’t need to rename the file, but just consolidate it in a folder with the other project materials.

  • Keywords embedded into file names. Some files don’t get renamed, but have keywords so Hazel knows what to do with them. “Maintenance” and “Medical Receipt” and “Receipt” and “Manual” are keywords I use a lot.

  • “Invitation” keyword: I make sure all our invitations get into a shared family Dropbox folder. I name the file with the date of the event and add “invitation” at the end. Hazel looks for this keyword, moves the invite to the family folder, and then creates a new Fantastical event on the event date in our Family Calendar with the info from the file’s name. I have to manually attach the pdf to the calendar event and add in the start/end times. (I also use Hazel to archive past events from this folder so it is not junked up with old stuff.)

4 Likes

My Hazel rules are getting hard to manage/review and cull the redundant as Hazel working space is not expandable. I have started prefixing the rule name to create searchable groups of rules. I noted with interest a blog the other day where a user is transitioning out of Hazel to Keyboard Maestro because the writer claimed the “rules” easier to manage in the Keyboard Maestro format. Any thoughts out there on this issue?

I love Keyboard Maestro but you’d have to pry Hazel out of my cold, dead hands.

Yes, the KM window allows organization with a level of folders, which I usually do by app, machine, or project/client. Hazel requires you to scroll, but I only find that to happen in my centeal incoming folder…Downloads. Perhaps think of breaking up the Downloads folder itself if you can’t abide the scrolling. Am away from my laptop but I think there might be a search box in the Hazel window.

2 Likes

I use Hazel to sort my download folders, separating MS Office files, PDFs and Images. Then I have Hazel watch those folders. If I save a Word Doc to the PDF downloads folder, it runs a script converting the Doc file to PDF and moving the original appropriately. I also sometimes convert PDFs to PNG using a similar method. I’ve appreciated the low mental friction of this method because I can save files according to what I want them to be and let Hazel do the rest.

Hi! Rose posted that one on the Automators Forum. I want to try it, but with DTPO.

3 Likes

Wow! Any recommended resources? Did this come together slowly?

Have it set-up, and it’s really useful!

Despite DefaultFolderX making it quick and simple to save my SnappyApp ‘snaps’ to a particular folder, I would often take a screengrab with the idea of sharing it, either on the web or via email.
So the process would involve saving the files, and then ‘Yoinking’ them thereafter, to quickly get them where I needed them.

With your suggestion, adding “_2Y” to end of a saved ‘snap’, sees it kept inside my SnappyApp folder for later use, but also instantly available on Yoink, which saves a few steps – always a win! :slight_smile:

1 Like

I’m not going to talk about all my monitored folders and rules (I’ve got 81 of them), but just a few that I’ve taken beyond what I suspect is typical. The following are all part of monitoring the download folder. Hazel rules take care of all the different file kinds, with everything but PDF handled first. If I download a calendar event, this puts it in my calendar:
91_image
The obscured last action moves the ICS file to the trash.

All the PDF statements are handled as shown, looking into the PDF to determine where the statement is from and what account it belongs to. This is for my Chase Bank credit card. The important thing of interest here is that the Move is done before the Rename. This is important when the destination is on a separate computer and the share might not be mounted. If the rename is done first and the move cannot be accomplished then the rule will be repeatedly applied and the renaming repeated. In this case, the name gets longer and longer until disaster ensues. By attempting the move first, if the move fails it will be reattempted until the share is mounted and the move succeeds. Then the file will be renamed. The tagging is so I know I haven’t reconciled the statement.
90_image
If the PDF file remains unprocessed, it might be that it needs to be OCRed. The final rule I’m showing is a modification of Katie Floyd’s, which in turn was a modification of David Sparks’. I use the Purple tag to indicate “OCRed” so an OCRed document will not be OCRed again. I also assume the the file has already been OCRed if it contains an “a” and an “e”. The AppleScript is the same as shown in an earlier post in this thread and runs PDPPenPro to OCR the document. “Continue Matching Rules” causes the list of Hazel rules to be reattempted for the document. If it still cannot be matched, it will sit in the Downloads folder with the purple tag which makes it easy to spot why it was there. A further rule tags anything left as “New” so I’ll also see it and manually take care of it.
92_image

3 Likes

Okay thank you. I had a work flow which did this in a fashion, but PDFpenPro would play up. At the moment I just have a work flow that identifies PDFs without OCR and I just sort that out, … I only get a handful of PDFs without OCR - nonetheless would like to get it working for my own satisfaction, Tks again!

I use a prefix convention and group my rules by that – it is a big list. Here are some of the prefixes:
Tag: [Deals with docs having any tags attached to them. These rules are at the list start]
Biz A [payroll/insurance/receipts]:
Biz B:
Finance: [bank statements]
Broker:
Insurance:
Medical:
Car:
Maintenance: [service receipts]
Utility: [The monthly bills]
Receipts: [Retail stores we frequent, may have returns.]

When I need to edit a rule, I go to the category and locate the rule quickly. It would be nice if Hazel added a rule search feature. I’ve got 50+ I’ve built up over the past few years.

That said, Hazel is a cheap Assistant and I don’t deal with much paperwork shuffling anymore. Can’t live without it.

2 Likes

Came together when I started to go paperless, probably within the first 3 months.

I crafted rules for all the routine stuff I found in my main folder that repeats. I also searched the internet for some useful Applescripts to assist.

Once you create a rule for one type of thing (e.g., store receipts that need saving) you just duplicate the Rule and then modify that for similar things in the category.

At this point, if Hazel doesn’t clear a routine item from my main folder there are 1 of 2 possibilities:

  1. I need to re-OCR the document– usually the issue.
  2. I need to tweak rules since the doc format changed– happens less and less often over time. Hazel has gotten better.
1 Like

Much appreciated sounds good

Ooh, please could you provide more information about this script, especially if it works without opening Word.

Great idea, thank you! I am using Hazel to rename and file invoices by looking at content. When I OCR the document and put it in the folder Hazel is monitoring, I see one file. Hazel is creating one file for each page of the document when it is renamed and filed in the proper folder. Does anyone else have this issue?

Thank you,

JS

Can you screenshot your Hazel rule and share it so we can test it?

@MacSparky will shudder at this one, but I have paper-generate Hazel rule (or an anti-paperless). Any ways, Hazel watches a couple of folder in Dropbox and for new files prints them. I use for business receipts and my invoices (my wife likes to track them with paper). This is very handy when I am travelling (I am currently working in the Gulf region) and I need to send a receipt to wife, it just prints on the printer in my office back home in Canada so she can add it to her files and take to the accountant.

I also use Hazel for converting XSL:FO (an XML document standard) into PDF using a Java process. I generate my invoices in FO into a folder and then Hazel runs the Java FO processor, then I copy the PDF invoice into my invoices folder where it gets printed (see above).

I also use Hazel to try and keep my Downloads folder clean. Anything that gets added to Downloads gets tagged Yellow. When I run an installer I remove the yellow tag and then later Hazel moves the DMG and PKG files to an installers folder in Documents. I like to save the installers in for provisioning new machines and so forth.

1 Like

Thank you for responding…I leave the file in the folder Hazel is monitoring and just want to copy it to another folder. Each time it copies and adds -1, -2 etc to the end of the file name.