Hazel Rule Examples

I find it to be 95% accurate.

Here you. Pretty simple, actually, once you know which trigger to use. Attaches to the Downloads folder.

50%20PM

Going to direct you to the person who created it: https://www.bartbusschots.ie/s/2017/11/24/automatically-adding-screenshots-to-yoink-with-hazel/

Then I used the same script for all the files that I need to work on immediately.

1 Like

one example is that I use Hazel to monitor 2 folders in Dropbox: 1 day and 1 week. (I think I got that one from Katy on one of the MPU episodes)

When I share a file with someone through dropbox I put it in either the 1day or 1week folder, get the link and let Hazel do the cleanup afterwards once the time limit is passed.

2 Likes

Apart from the dropbox one I also use it to clean up omnifocus backups, 1password backups and any other miscellaneous files out there that tend to pop up. It just looks at the dates, and after about 7 days puts them in the trash.

From there I set hazel to clean the trash at a specific size limit, and again, no hassle

I built a photo workflow based on this link, which is very helpful even if that’s not your goal:

Modified in part to include exiftool as discussed here:

https://www.noodlesoft.com/forums/viewtopic.php?t=3331&f=3

2 Likes

And lastly have it set up to monitor an icloud folder I drop all my files in from any device, it looks at the name/date/origin/content and sorts it according to some rules I set up.

one example:

if it is a pdf it looks at the content to see if it contains a + e + i + o (thank MacSparky for that one) If there not present it sends it to my OCR folder (also monitored by Hazel) for processing, and then gets returned and filed in Devonthink and my archive folder on my Synology.

Katie had a Hazel flow to look at PDFs and OCR them. Cannot track this down as she seems to be building new web page. Anyone have this?

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!