Skip to main content
Peckham
PROJECT
OCRO
GRAM
ProductGomacOS

ocrogram

I already screenshot error dialogs and Slack messages I can't select. Live Text is a gesture every time. So I built a login item that OCRs the screenshot I already take.

Take a screenshot. Paste the text.

I already take the screenshot

I copy a lot of text I can't select. Error dialogs, Slack screenshots people send me, a table locked in a PDF. Live Text can read those, but I have to click, drag, and copy every time. I already hit Cmd+Shift+4 for the picture. I wanted that to be the whole job.

So I built ocrogram. You install it, run ocrogram start, and leave it as a login item. After that, a normal macOS screenshot puts the text on the clipboard. Cmd+V works anywhere. Apple Vision runs on the Mac. I never added an upload path.

The shortcut you already use

Day to day

Cmd+Shift+4PNG in screenshot folderText on clipboardCmd+V

The screenshot shortcut you already use. You don't get a new hotkey or a crop window.

Install is two commands:

brew install joelpeckham/ocrogram/ocrogram
ocrogram start

That writes a LaunchAgent and loads it. Next login, it's already running. You need macOS 14 or later, and a screenshot that writes a file. Cmd+Ctrl+Shift+3/4 never writes one, so those are out of scope on purpose. If you leave screenshots on the Desktop, macOS may ask for Full Disk Access. I send mine to ~/Pictures/Screenshots instead.

Two binaries

The Go side is the daemon. It watches the screenshot folder (defaults read com.apple.screencapture location, or Desktop). When a file shows up, it waits 400ms of quiet so the PNG is finished writing. Then it checks whether the file is actually a screenshot: localized "Screenshot …" names first, Spotlight kMDItemIsScreenCapture if you renamed it.

The Swift side is ocrogram-helper. Vision is a Swift API, so the helper is the smallest process that can call it. It takes a path, runs VNRecognizeTextRequest, and writes the result to NSPasteboard. Exit 0 if it found text. That's the whole contract. There is a Go test that feeds it hello.png and asserts HELLO.

Homebrew upgrades used to leave the LaunchAgent pointing at a dead Cellar path. The installer now rewrites that to the stable bin/ocrogram prefix, so the login item survives brew upgrade.

Inside the daemon

fsnotify400ms settlername or mdlsSwift Vision helperNSPasteboard

Watch the folder, wait for the write to finish, OCR on-device, copy the text.

I didn't build another OCR hotkey

Those exist, and they're fine if that's your habit. ocrogram watches files. I built it because I already hit Cmd+Shift+4 and then wanted the text.

MIT, Homebrew, source on GitHub. I leave it running.