Hazel rule to act on academic PDFs, but not others

As the title says, it would be nice to have a Hazel rule to move academic papers into a folder for Bookends to import, while leaving non-academic PDFs in the Downloads folder.
It seems this might have to be a two-folder process, since Hazel has ‘any’ and ‘all’ logic, but not ‘AND’, ‘NOT’, etc.
Maybe an ‘All’ rule:

Extension is ‘pdf’
Contents contains ‘doi’

Just reaching out to see if I’m missing something…


If you press ALT/OPT you can add sub rules.


You can also set a Hazel rule for downloading .ris files that most citation managers recognize. I have a Hazel rule set to watch my Downloads folder for .ris files, then moves it over my citation manager (Mendeley) to be opened. I then manually process the PDF contained within, i.e. skimming, deciding how deep to delve into it, etc.

I have another rule set up that deletes the .ris files from the Downloads folder if they’ve been in there for 24 hours.

1 Like

Did you manage to sort this out John? I do this myself by using nested conditions, and checking the contents for different rules, like the DOI as you suggest. Something I find helps though, is to have a rule that move the documents into a clearing folder first, and to run the rules on that folder.

My fix so far has been to stop Hazel before I download an academic pdf, download, move to Bookends, and start Hazel again.
So efficient :slightly_smiling_face:
I’ll try Rose’s sub rules, and your idea for staging, which should help.
Thanks for all, the suggestions!

What you describe in your OP can most likely be solved by nested conditions in the rule you want to capture the academic papers. Like below. Good luck :slight_smile:



Just for reference, here’s a lovely sed command for finding DOIs in PDFs:


1 Like