[SOLVED] Need help to extract the title from this PDF with Hazel


I’d like to set a rule on Hazel about the academic papers I download from a platform.

The rule should be:

  1. In the Download folder, detect if the new PDF comes from that platform
  2. Search for the title inside the PDF and grab it
  3. rename the file with the title you have grabbed from the PDF
  4. move the PDF to the destination folder

I need help to accomplish the point 2, because there aren’t stable characters before and after the title of the research, so I don’t know how to point Hazel to the title.
Before and after the string of text there are the authors, the DOI and other variables that are different on each research.

In the screenshot you see how that page of the PDF appears to us and to Hazel.

Hazel sees that section as:

Edited by: Béla Birkás, University of Pécs, Hungary Reviewed by: Marta Malesza, Jagiellonian University, Poland Cristina Ene, University of Bucharest, Romania *Correspondence: Worakamol Wisetsri worakamol.w@bid.kmutnb.ac.th Irfan Ullah irfanullahkhan9214@gmail.com Specialty section: This article was submitted to Health Psychology, a section of the journal Frontiers in Psychology Received: 06 April 2022 Accepted: 02 June 2022 Published: 04 July 2022 Citation: Shengbo L, Fiaz M, Mughal YH, Wisetsri W, Ullah I, Ren D, Kiran A and Kumar Kesari K (2022) Impact of Dark Triad on Anxiety Disorder: Parallel Mediation Analysis During Pandemic. Front. Psychol. 13:914328. doi: 10.3389/fpsyg.2022.914328 ORIGINAL RESEARCH published: 04 July 2022 doi: 10.3389/fpsyg.2022.914328 Impact of Dark Triad on Anxiety Disorder: Parallel Mediation Analysis During Pandemic Liu Shengbo1, Muhammad Fiaz2, Yasir H. Mughal3, Worakamol Wisetsri4*, Irfan Ullah5*, Diandian Ren6, Alina Kiran7 and Kavindra Kumar Kesari8,9

Here the title is:
Impact of Dark Triad on Anxiety Disorder: Parallel Mediation Analysis During Pandemic

Thank you!

Have you tried instead of looking inside the pdf, inspecting the title of the pdf? A la PDF properties and metadata, Adobe Acrobat

It’s possible the title is in there

1 Like

It works!
Indeed, there are lots of information in the Information box of such PDFs.
Good to know.

Thank you very much!

Hello there. I’m retired now but still check the psychiatric journals daily and download articles of interest to me (anxiety, depression, personality disorders, and pharmacotherapy). I have a very large library that I manage with a Zotero drop folder (with Zotfile and Better BibTex). The system works fine for me, not that I’ve ever been entirely satisfied with any of the citation managers I’ve used over the years. Even now, Zotero doesn’t recognise lots of my downloads.

I’ve previously tried to do what you posted about: using Hazel to name PDFs. I never worked out how to do it. Would you mind sharing your Hazel workflow? I didn’t grasp how the suggestion to look in the file a la Acrobat actually worked.

Thanks, Peter

Hi Peter,
I’ve found this workaround: in the metadata of the PDF the title is the name of the research, so I just had to look for the title in the metadata and rename the file with it.

Here some screenshots…


That looks really interesting. Thanks for taking the time to post the very useful screen shots.

1 Like

@cehm18 you’re welcome!