Help with Hazel action on PDF use with an app

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Recently purchased Hazel but having trouble with anything more than simple actions. Here is something specific I could use help with:

I frequently (10-40x / day) download PDF files to my Downloads folder. These are journal articles.
Hazel moves these to another folder inside Downloads called PDFs for Mendeley
Mendeley is a reference manager that watches specific folders (in this case PDFs for Mendeley ), changes file names (based on metadata) and imports files to its own folder (much like iTunes does if you ask it to consolidate).
Once Mendeley has read the file, I'd like to delete the PDF from PDFs for Mendeley .
But how?

Step one (Hazel moving file from Downloads -> PDFs for Mendeley) already works.

How do I tell Hazel to see if date pdf was added is older than when Mendeley was last launched and if so, delete said file?
maiasaura
 
Posts: 5
Joined: Thu Feb 02, 2012 5:40 pm

That sounds like very specific logic. You would need to write a script to do that. Otherwise, is it possible to have Hazel send the file to Mendeley directly, via Automator? If you do that, then you can have Hazel throw away the file afterwards.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I use two rules for this.

  • One rule to open Mendeley when a new file is added to the Mendeley watched folder. Mendeley will then import the files in the watched folder
  • One rule to delete any file in the watched folder older than a certain age (in my case, 1 hour).
The combination doesn't delete the PDF imported to Mendeley until another PDF is added to the folder over an hour later. But it does keep the folder tidy.

The uncertainty is that if — for any reason — a file is not successfully imported into Mendeley, adding a new file to the watched folder will cause the older file to be deleted, and the Mendeley import will have been skipped. But I've never had that happen.
gtuckerkellogg
 
Posts: 1
Joined: Tue Nov 05, 2013 6:47 pm


Return to Support