A macOS tool that captures a screen region, runs OCR via the native Vision API, and copies the result to clipboard. Integrates with Raycast as a Script Command.
- Press a hotkey in Raycast
- Select a screen area
- Text is recognized and copied to clipboard
- A sound plays to confirm
- macOS 13+ (Ventura or later)
- Python 3.10+
- Raycast
bash install.shThis will:
- Create a Python virtual environment
- Install dependencies
- Register a LaunchAgent (auto-starts the OCR server on login)
- Wait for the server to be ready
Then in Raycast:
- Open Settings > Extensions > Script Commands
- Add this project directory
- Assign a hotkey to "OCR Screenshot"
OCR Server (ocr_server.py) — FastAPI server on 127.0.0.1:19876 using macOS Vision API. Runs as a LaunchAgent, auto-restarts on crash.
Raycast Script (ocr.sh) — Captures a screen region via screencapture -i, sends it to the server, copies the result to clipboard, plays a sound.
Ukrainian, Russian, English — detected automatically by the Vision framework.
# Start the server
.venv/bin/python ocr_server.py
# OCR a file
curl -s -X POST http://127.0.0.1:19876/ocr -F "file=@screenshot.png"
# Health check
curl http://127.0.0.1:19876/healthlaunchctl bootout "gui/$(id -u)/com.ocr.server"
rm ~/Library/LaunchAgents/com.ocr.server.plist