- SnipText is under ongoing development; build configuration and features will evolve alongside the main README instructions as time allows.
- macOS is fully supported today; Windows/Linux ports are planned and will be documented once available.
- Desktop utility that lets you select an area of the screen, runs Tesseract OCR on the captured pixels, copies the recognized text to the clipboard, and (optionally) saves the screenshot.
- Ships with a minimal Qt Widgets UI: one button to start a capture, overlay color selector, and toggle for saving screenshots.
- Features/UI are still evolving; expect updates as development continues.
- Targets macOS builds only (Qt Widgets app bundled as a .app).
- Uses AppleClang with C++17, Qt5/Qt6 Widgets, and Tesseract OCR + Leptonica.
- Android / Windows / Linux boilerplate generated by Qt remains untouched for now; future work can expand those sections.
- CMake expects Qt to be discoverable via
QT_DIRorCMAKE_PREFIX_PATH. - Example:
cmake -S . -B build -DQT_DIR=/Users/me/Qt/6.6.3/macos/lib/cmake/Qt6. - All sources are bundled into
qt_add_executable(Qt6) oradd_executable(Qt5).
- Configurable prefixes:
TESSERACT_ROOT— base prefix containinginclude/andlib/for Tesseract (defaults to/opt/homebrew,/usr/local,/opt/local).TESSDATA_PREFIX— directory containingtessdata/files. Defaults to${TESSERACT_ROOT}/share/tessdata(e.g.,/opt/homebrew/share/tessdata).
find_pathandfind_librarylocate headers (tesseract/baseapi.h) and libs (tesseract,lept/leptonica).- On failure, configuration stops with guidance to install Tesseract (e.g.,
brew install tesseract) or setTESSERACT_ROOT. - Runtime library paths (RPATHs) are set from the located libraries so macOS’s dynamic loader (dyld) picks them up automatically without extra environment tweaks.
- The resolved tessdata path is baked into the binary via
DEFAULT_TESSDATA_PATHso OCR init uses that location without editing the source.
mainwindow.cppreadsDEFAULT_TESSDATA_PATHand passes it toOcrService::initialize().- If OCR init fails (for example due to a bad tessdata path), the app shows a warning dialog and continues running, but captures won't produce text until it’s fixed.
- Windows/Linux support would extend
_TESS_SEARCH_PATHSand add platform-specific logic for library names / RPATH equivalents.
- On macOS, grant SnipText screen-recording permission (System Settings ▸ Privacy & Security ▸ Screen & System Audio Recording) so the capture overlay works.
mkdir -p build
cmake -S . -B build \
-DQT_DIR=/path/to/Qt/lib/cmake/Qt6 \
-DTESSERACT_ROOT=/opt/homebrew \
-DTESSDATA_PREFIX=/opt/homebrew/share/tessdata
cmake --build build
Adjust the prefixes to match your environment; once CMakeCache.txt exists you can run cmake -LH build to review/edit cached values.
