Do You Use Hazel? What Is Your File Management Workflow?

Perhaps a bit off topic for a KM forum but I still think that Hazel fits the 'automation' bill quite well. One thing that I am curious though is whether anyone here is using it or perhaps tried using it? Is it worth it?

This forum has a lot of smart individuals and I would love to hear your opinion on it. I am also really curious how you guys manage your files?

For me, I simply organise my files in Documents :

And don't really have any file automation in place. I organise all my media with Pixave, all my writing with Ulysses and personal photos in Photos. The rest are just various pdf's and files and code that I am starting to write. :slight_smile:

I am learning quite a lot about linux and unix and am fascinated by the idea that everything in unix is essentially a file, even a process is a file you can inspect. Would love to hear how you guys organise your files. Thank you for sharing.

1 Like

Of course, Hazel is absolutely great. It’s the grandmaster of folder watching. (This corresponds to KM’s “Folder Trigger” or macOS’ “Folder Actions”.) It has very fine-grained trigger options and file actions.

It also has a special and very neat “Trash watching functionality”. I’ve set it to delete files older than 3 months from the Trash, and since then I’ve never emptied the Trash manually.

So you use that, instead of something like this, which you wrote?

By the way, I have to say that the above macro is a thing of beauty. Love the help text, never would have thought to do it like that, yet it’s so obvious. Love the “Dry Run” feature. Awesome!

1 Like

LOL, you are right. I still use my macro sometimes for emptying the Trash of external disks. But the “regular” Trash (startup volume) is in hands of Hazel.


And, obviously, the Files bigger than and Last timestamp features of my macro are “inspired” by hazel :wink:

1 Like

Many of my best ideas are “inspired”. Yeah, I like that. “Inspired”.

OK, I confess, I have stolen it from Hazel :sunglasses:

Who stole it from… who stole it from…

It’s not stealing, it’s an homage. Just like “Ice Ice Baby” was an “homage” to “Under Pressure”. OK, maybe I went too far there. LOL.


Yep, that’s a great word: Homage. I’ll use that one next time.

You are a poet :smile:

1 Like

I use Hazel for a range of things, most significantly for

  1. transferring photos from one of the phones in the household.It’s a WinPhone and so photos are automatically fed to OneDrive, from where Hazel distributes them to a NAS and the OSX Photos app.

  2. Hazel can also be used to watch your downloads folder, and file things correctly if you spend some time on the rules. Which leads to:

  3. I also scan everything to one folder, watched by Hazel, and again quite a lot can be filed by Hazel.

  4. An in-house requirement of one of my clients is that only certain file-types should be retained before archiving closed assignments. Hazel does that; there’s no way I’m going through folder trees seeking out .docx and other files…

I’d suggest going to the Hazel forums. There are some sophisticated rule sets which mean it’s even possible to automatically rename and file (say) scanned bank statements based on bank name and date.


I cannot recommend both KM and Hazel enough! Both make my life so much more productive on the Mac. Hazel is a folder watcher. It just sits there and watches a folder. If something changes in the folder you can define rules to make it do something. For example, point it at your Downloads folder and then make it move/tag/rename a pdf file to another folder. It can look in a file, find a string (“gas company”) and then move/tag/rename it to the proper folder. I have it watch my Client folder and if and if a file is changed/added in any of the subfolders, then Hazel will automatically copy it to my Synology (in the proper folder). It can organize your photos. I have a Hazel watched folder that if a file is added, it will open Evernote, copy the file to a certain notebook, then moves the file to an “archive for a couple days” folder. Then after a couple of days, Hazel assumes I don’t need the file and deletes it. It’s very helpful.


I use Hazel for many things. But, the most important of them is managing and processing PDF files. I spend most of my days working on PDF files (I am doing my phd).

Hazel does: Download folder:

  1. if the file is DJVU or Chm or sth like that --> send it to Devonthink watch folder (2Devon)
  2. If the file is EPUB, or MOBI–> Send it Calibere watch folder
  3. if the file is PDF–> send it to Bookends watch folder (I call it 2Bookends)
    (and other cleaning ups of the Download folder)

ON the PDF files:

Once they are imported to the Bookends library, Hazel picks them again and does a number of things on them:

  1. Cleanup the metadata (using some scripts) -->
  2. Fix problems
  3. Mark them if they are OCRed or not
  4. OCR if they are not OCRed (using AbbyFine Reader)
  5. Tag them by searching key terms in the document
  6. Copy each of them to another folder -->
  7. Split (burst) the copied file into smaller pieces (using scripts)–>
  8. Move the splitted files to another folder; The slitted files are indexed into FoxTrot
    (the slitting is meant improve the accuracy of the search)

This is really interesting. Automating some of my pdf downloads would be nice indeed. I am curious what kind of scripts you use to ‘cleanup the metadata’ if you don’t mind sharing?

I am not sure if the script will be useful for you because it cleans up the metadata based on my file naming convention. Look; I tell Bookends to rename my PDF files on a certain format:

Author Year Title

What does this script does is then, embed these elements into the metadata of the PDF (a straightforward way would be to have Bookends directly embed the metadata into the file; but, bookends cannot do so yet)

The embedding of the metadata is done by standard shell script in combination with exiftool; another potent metadata manipulation tool widely used for archiving photographs (media files). It also works well with PDF files.

Here is Hazel rule (a lot idiosyncratic rule; You have to simplify them to fit your needs)

and, here is the script:

author=${title%% *}; title=${title#* }
year=${title%% *}; title=${title#* }
exiftool -Author="$author" -Title="$title" -CreateDate="$year" "$1"

blank_data is a tag I use to mark PDF files which contain no metadata. For files which contain a good metadata, there is no need to overwrite them.

How do I know which of the files have blank metadata? I made Hazel to inspect the files. It inspects them and tag them with blank_data, before running the above rule.


I mainly use Hazel to organize my photos. I have a Sony DSC-RX100 (M1) and every time I connect the camera or the SD card on the MBP, Hazel does the next jobs:

  1. If the file is a RAW, it moves it to a JPG folder. If it’s a RAW, obviously moves it to a RAW foldes
  2. Rename all files to “RXYYYYMMDDHHMMSS”
  3. Then sorts them into a year-month (2017-11) taking the “Date takken” for the sorting proccess

This is a huge relief! Months ago, I had to copy the JPG files to its respective folder and the same with the RAW, then start the nightmare of the sorting.

Hope this result heplful to anyone… Sorry for my English, I’m from Venezuela

I push everything possible to my A-Z Finder folders that reside in iCloud.

Hazel watches the Desktop for emails I drag onto it (which is every email I get and which action KM does for me with a click) to auto-file ones I've identified usually using Hazel's "Content" + "content match" conditions which reads emails well.

I have a current month folder that Hazel moves many emails to for most monthly expenses I get notified via email.

Hazel also watches dozens of FileThis (FileThis automatically downloads your digital statements) folders to move their contents to the correct A-Z file.

Hazel moves anything that downloads to my Downloads folder to the desktop which the Desktop rules then handles. This eliminates the Downloads folder as yet another place for things to get lost in or needs to be addressed.

Most call me obsessive about the level of detail I bring to somethings yet given how little I actually have control over in this big wide world, I'm taking as much control as I can muster over this little tiny domain I have within my 27" monitor and physical desktop :wink:

As @nikivi to @MitchellModel in the long and great "MACRO: [KMFAM] Favorite Actions and Macros" posting by @DanThomas said in part "...optimising my personal workflow is kind of like a hobby." and one I greatly enjoy at the moment.

Anyway, I use Hazel to move AND tag as unread ("unread" being a MacOS tag I made) emails from a political mailing list that I keep meaning to read but likely am just fooling myself about and will probably just delete on mass when I get straight about it :wink: The neat part is that these email come in various formats, yet, Hazel allows as many and varied conditions to cover anything they send.


Hello @Desalegn, could you please guide me to how you do this? I've been searching for ages (for my huge PDF collection) and just reading through your process I see it's possible.


@Dave_H To use contents in Hazel you need a searchable PDF. With my ScanSnap I can make that. PDFpen has also an option to make them searchable. If it is not searcheable I don't think it will work.

This is very simple:
Here is how I tag all the pdf files that contain the terms such as "causative", "causee" or "causation" with the tag "caus":

The problem with this approach is that it tags a lot of documents that are not directly relevant to "causation". There would be a lot of false positives.
A useful development would be to search the terms only within the "keywords" section of the document. I didn't find any script of that kind. Another approach that quite fairly minimized the false positives was to restrict the search to the first 2-3 pages of the document. The page counting requires some additional scripts.

Hi, sorry for having been off for months.

I get your approach and it's quite close to the one I'm already using. But I'm looking to go further:

  • Have a searchable PDF
  • Go through it, determine the major keywords and order them by frequency of occurrence
  • Choose the first three ones as tags
  • Tag the PDF with it.

It's quite exactly what Devonthink achieves. So I'd like to do so, but at the file system level, not with a heavy software like DT.

Apologies in case this is going off-topic... And thanks in advance for any insight.

Hey Dave,

Here's a starter kit.

Extract Text from an OCR'd or Text PDF v1.00.kmmacros (6.8 KB)

From there you can parse the text to your heart's content.


1 Like