Automatically renaming PDF files with Date from content (2)

hello forum,
I want DEVONThink to automatically rename PDF files that I imported in the Inbox. So far I’ve been using Hazel for this. Hazel until now changes the filename before importing. But I read in this forum that DT can also do this Automatisches Umbenennen von PDF-Dateien mit Datum aus Dokumentinhalt. My problem is how to do that in DT. Whether with intelligent rules or with batch processing? I don’t know how that works. Documentation with a description would be helpful. Can someone please help me? I have always created the file names of my PDF files like this: Date_Sender_Subject.pdf . E.g. 2021.01.26_DKB_changes to the contract terms as of April 1, 2021. What do I have to set exactly that DT like Hazel reads the date from the document and enters the sender name, e.g. DKB. I always copied the subject into the file name myself.
Many thanks for your help
Hello Holger

Hallo Forum,

Ich möchte, dass DEVONThink PDF Dateien, die ich im Eingang importiert habe, automatisch umbenennt. Bis jetzt verwende ich dafür Hazel. Hazel ändert bis jetzt den Dateinamen vor dem Import. Ich habe aber in diesem Forum gelesen, dass das auch DT kann Automatisches Umbenennen von PDF-Dateien mit Datum aus Dokumentinhalt . Mein Problem ist, wie ich das aber in DT hinbekomme. Ob mit Intelligenten Regeln oder mit der Stapelverarbeitung? Ich weis nicht wie das funktioniert. Eine Dokumentation mit einer Beschreibung wäre hilfreich. Kann mir da bitte jemand helfen? Ich habe den Dateinamen meiner PDF Dateien bis jetzt immer so angelegt: Datum_Absender_Betreff.pdf . Z.B. 2021.01.26_DKB_Änderungen der Vertragsbedingungen zum 1. April 2021 . Was muss ich genau einstellen, das DT wie Hazel das Datum aus dem Dokument ausließt und den Absendernamen z.B. DKB einträgt. Den Betreff habe ich immer selber in den Dateinamen einkopiert.

Vielen Dank für eure Hilfe

Ciao Holger

This topic has been discussed many times already. You might

  • want to have a look at the documentation (everything under “Automation”, especially the sections on smart rules
  • search the forum for “rename date” or something like that
  • have a look at Using a single smart rule instead of Hazel (maybe) (which I’m using also for my DKB account statements, btw).

Automation is sensible for things that occur often. In your example case, writing a rule/script to automatically set the name from the content might just be too much work. Banks are not changing their conditions more than one or two times a year, I guess.

Having said that, I’d suggest to think about automating everything that occurs sufficiently regularly. In my case, that’s account statements, recurring telecom and other bills – all arrving once per month. Everything else, I do manually. To take care of every possible subtlety in a smart rule or a script is just too much work.

Also, you should be aware that PDFs as such might not contain a date. Only if they also contain a text layer can you hope for a document date. So a smart rule (or script) should always check if a text layer is available and run OCR on the document if not. A notable example for this missing text layer are invoices from German Telekom: while their fixed line invoices are perfect, mobile ones have to be OCR’d first.

1 Like