# Automatically renaming PDF files with Date from content (2)

**URL:** https://discourse.devontechnologies.com/t/automatically-renaming-pdf-files-with-date-from-content-2/70008
**Category:** Automation
**Created:** [March 12, 2022, 10:05am UTC](https://discourse.devontechnologies.com/t/automatically-renaming-pdf-files-with-date-from-content-2/70008 "2022-03-12T10:05:20Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)
#### Post date: [March 12, 2022, 10:25am UTC](https://discourse.devontechnologies.com/t/automatically-renaming-pdf-files-with-date-from-content-2/70008/2 "2022-03-12T10:25:32Z")

</div>

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)](https://discourse.devontechnologies.com/t/using-a-single-smart-rule-instead-of-hazel-maybe/67982) (which I’m using also for my DKB account statements, btw).

> [@Holger-erf](#):
>
> I always copied the subject into the file name myself.

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.

---

_[View the full topic](https://discourse.devontechnologies.com/t/automatically-renaming-pdf-files-with-date-from-content-2/70008)._
