tidy.
Writing

How to rename scanned PDFs on a Mac, by what is inside them

Sebastián Díaz Thomas · Santiago, Chile · August 2026

You scan a stack of paperwork. Your scanner, or the Notes app, or your phone, hands you a folder full of files called Scan 2026-08-02 at 11.20.pdf. Six months later you need the warranty for the fridge and you have no idea which one it is, so you open them one at a time.

The frustrating part is that the answer is written inside every one of those files. Your Mac just is not reading it. Here is why, and four ways to fix it, from free and manual to automatic.

First: check whether your PDF actually has text in it

PDFs are two completely different things wearing the same extension.

A PDF exported from Word or a web page carries a text layer: the characters are in there as characters. A PDF that came out of a scanner or a phone camera is a photograph of a page. To the computer it is pixels. There is no text in it at all.

The one-second test: open it in Preview and try to select a line with the cursor. If you can highlight the words, there is a text layer. If your cursor just draws a rectangle over the page, there is not.

From the Terminal you can check a whole folder at once:

for f in *.pdf; do
  strings "$f" | grep -qm1 "/Type/Font" || echo "no text layer: $f"
done

Every PDF that holds real text carries font objects inside it. A photograph of a page carries none. Anything this prints has nothing in it for a search to read. Not "a little", not "it will index later". Nothing.

It is a rough count, not a verdict: a PDF can compress its own structure and be reported wrongly. Dragging the cursor across the words in Preview is the check that never lies.

This is why searching for a word you know is in the document returns no results. Spotlight is not failing. There is genuinely nothing there for it to read.

And it is why the filename matters so much for scans: it is the only handle you have on that document. Which is exactly the thing that is set to the date and time you happened to press the button.

Option 1: give the PDF a text layer, then rename it yourself

This is the traditional route and it is worth knowing even if you end up automating it. You run the scan through an OCR program that writes the recognised text back into the PDF as an invisible layer. From then on the document behaves like a normal PDF: Spotlight indexes it, Preview lets you select the text, and you can copy the vendor name out to paste into the filename.

Most scanner software does this if you turn it on. Dedicated OCR apps do it better. It is the right answer when your problem is searching inside the documents, and it is the only one on this list that also fixes Spotlight permanently.

What it does not do is name anything. You still open each file and type.

Option 2: Shortcuts, if you are patient

macOS Shortcuts has an Extract Text from Image action, and it runs on your Mac without sending anything anywhere. It is the same text recognition Apple uses for Live Text.

The catch is that it wants an image, and you have a PDF. So the shortcut has to turn the page into an image first, extract the text, pull the useful part out of it with text actions, and then rename the file. That middle step, "pull the useful part out", is where most people abandon the project, and for a good reason that I will get to.

It is free, it is local, and if you only handle one predictable kind of document — say, statements from one bank — it works well.

Option 3: a rules app

Hazel has been the standard here for years. It watches a folder and applies rules you write. Since version 6 it can also run text recognition on a non-OCRed file when it needs to match against the contents, which means you can write a rule like "if this PDF contains Acme Insurance, rename it and file it".

It is powerful and it is deterministic, which matters. The trade-off is that you write a pattern per kind of document. And in practice those patterns break: a user on the Mac Power Users forum described giving up on exactly this task because "the file formats change continually and rapidly" — the bank redesigns its statement, the pattern stops matching, you rewrite the rule.

Hazel is $42, one-time.

Option 4: let the Mac read it and propose the name

The fourth approach skips the rules: read the document, work out what it is, name it from that. No pattern, no per-vendor setup.

This is what I spent the last few months building, so treat what follows as informed rather than neutral.

The part nobody warns you about: reading is easy, naming is hard

Every option above shares the same second half of the problem, and it is much harder than the first.

Getting the text out is basically solved. Apple's Vision framework reads a crumpled receipt photographed at an angle in bad light, on the device, in well under a second. That part is genuinely good and it is free to any developer.

Then you are holding forty lines of text and you need three of them.

A supermarket receipt has the shop name somewhere near the top, but not always. It has a date, which may appear in four different formats on the same piece of paper. It has a total, which sits near the word for "total" in whatever language the receipt is in. It has an address, a tax number, a cashier's name, a loyalty scheme, and a slogan.

I tried handing that decision to a local language model. It understood the documents beautifully and failed at the mechanics: it would return a name with a slash in it, which the filesystem will not accept. It would give me a date that was on the page in a different format. It would return the same name for two different files, which quietly overwrites your data if you are not careful.

Semantics excellent, mechanics unreliable. So the mechanics have to be code, and the model only chooses between candidates the code already found in the document.

That inversion is the whole trick, and it is also the honest answer to the objection that local AI hallucinates. It does. So do not ask it to invent anything. The OCR reads what is on the page — reading is not hallucinating — and the model only picks which of the things on the page should be the name.

Two rules I would keep whatever you choose

  1. Never overwrite. Two invoices from the same vendor in the same month will produce the same name. Whatever you build has to check for an existing file first, every time.
  2. Make it reversible. A batch rename that cannot be undone is a batch rename you will run once and never again, because you will not trust it. Undo is not a nicety here, it is the thing that lets you use the tool at all.

The app I built is Tidy. It reads what is inside your images and scanned PDFs with Apple's on-device text recognition and names each file from its contents, and it lets you search inside those scans that Spotlight cannot see. $9 once, no subscription, macOS 14 and up, and nothing ever leaves your Mac. It never deletes anything and every run undoes in one click. I am a solo developer in Santiago, Chile, and I answer every email myself.