Watch a folder for PDFs and run OCR so Spotlight can index them.
Scanned PDFs are just images — Spotlight can't search their text. watchdoc runs OCRmyPDF on them automatically, adding a searchable text layer in-place.
curl -fsSL https://raw.githubusercontent.com/clstaudt/watchdoc/main/install.sh | shThis single command installs everything: Homebrew (if missing), uv (if missing), system dependencies (tesseract, ghostscript, terminal-notifier), and the watchdoc CLI.
watchdoc run ~/Documents/ScansProcesses all *.pdf files in parallel (one per CPU core), then exits.
watchdoc watch ~/Documents/ScansStays running and OCRs each new PDF dropped into the folder. Stop with ctrl-c.
watchdoc install ~/Documents/ScansInstalls a macOS launch agent that triggers automatically whenever the folder contents change.
watchdoc uninstallRemoves the launch agent.
| Flag | Commands | Description |
|---|---|---|
--output-dir DIR |
run, watch |
Write OCR'd copies to a separate folder instead of replacing in-place |
brew install tesseract ghostscript terminal-notifierCheck what's missing with:
watchdoc deps- tesseract — OCR engine
- ghostscript — PDF rasterizer
- terminal-notifier — optional, shows a notification with the watchdoc icon when processing completes
PDF added to folder
│
▼
watchdoc run
│
▼
ocrmypdf (mode=redo)
│
┌─────┴─────┐
│ tesseract │ ← extracts text from page images
│ghostscript │ ← rasterizes PDF pages
└─────┬─────┘
│
▼
PDF with text layer
│
▼
Spotlight indexes it
MIT
