How tausif40/snaptext works
SnapText is a macOS menu-bar app for on-device screen OCR and persistent clipboard history. Users invoke capture, select a screen region, recognize and copy text; separately, clipboard monitoring saves eligible copies for searchable history and paste-back. The graph includes settings, shortcut registration, permissions/pasting, and the UI layers. Edges follow the excerpts or README; several source modules were indexed but not sampled, so their internal links are omitted where behavior is not evidenced.
Main entry points: AppDelegate.swift App Coordinator · HistoryPanel.swift History Search Panel · ClipboardHistory.swift History Store · SettingsView.swift Settings View
Components 19
App Shell
- App Entry
Sources/SnapText/main.swift - App Coordinator
Sources/SnapText/AppDelegate.swift - Capture Notices
Sources/SnapText/HUD.swift
Screen Capture
- Screen Selection
Sources/SnapText/ScreenCapture.swift - Text Recognition
Sources/SnapText/TextRecognizer.swift - Text Layout
Sources/SnapText/TextLayout.swift
Clipboard History
- History Store
Sources/SnapText/ClipboardHistory.swift - Clipboard Watcher
Sources/SnapText/ClipboardWatcher.swift - Paste Back
Sources/SnapText/Paster.swift
User Interface
- History Search Panel
Sources/SnapText/HistoryPanel.swift - Main Window
Sources/SnapText/MainWindow.swift - Settings View
Sources/SnapText/SettingsView.swift
Settings And Shortcuts
- Persistent Preferences
Sources/SnapText/Preferences.swift - Shortcut Model
Sources/SnapText/Shortcut.swift - Global Hotkeys
Sources/SnapText/GlobalHotKey.swift - Shortcut Editor
Sources/SnapText/ShortcutField.swift - Launch At Login
Sources/SnapText/LaunchAtLogin.swift
Other components
- Mac User
- macOS Services
Connections 28
- Mac User → App Entry: launches
Sources/SnapText/main.swift - App Entry → App Coordinator: instantiates
Sources/SnapText/main.swift - App Coordinator → Clipboard Watcher: starts
Sources/SnapText/AppDelegate.swift - App Coordinator → Text Recognition: warms up
Sources/SnapText/AppDelegate.swift - App Coordinator → Global Hotkeys: registers
Sources/SnapText/AppDelegate.swift - Global Hotkeys → Shortcut Model: uses
Sources/SnapText/GlobalHotKey.swift - App Coordinator → Screen Selection: captures selection
Sources/SnapText/AppDelegate.swift - App Coordinator → Text Recognition: recognizes image
Sources/SnapText/AppDelegate.swift - App Coordinator → Text Layout: formats text
Sources/SnapText/AppDelegate.swift - App Coordinator → Capture Notices: shows notices
Sources/SnapText/AppDelegate.swift - App Coordinator → History Store: adds capture
README.md - Clipboard Watcher → History Store: adds copies
Sources/SnapText/ClipboardWatcher.swift - macOS Services → Clipboard Watcher: provides clipboard
Sources/SnapText/ClipboardWatcher.swift - App Coordinator → History Store: owns
Sources/SnapText/AppDelegate.swift - App Coordinator → History Search Panel: opens
Sources/SnapText/AppDelegate.swift - History Search Panel → History Store: searches and removes
Sources/SnapText/HistoryPanel.swift - History Search Panel → App Coordinator: selects text
Sources/SnapText/AppDelegate.swift - App Coordinator → Paste Back: pastes selection
Sources/SnapText/AppDelegate.swift - Paste Back → macOS Services: posts paste keys
Sources/SnapText/Paster.swift - App Coordinator → Main Window: shows
Sources/SnapText/AppDelegate.swift - Main Window → Settings View: shows settings
Sources/SnapText/MainWindow.swift - Settings View → Persistent Preferences: reads and writes
Sources/SnapText/SettingsView.swift - Settings View → Shortcut Editor: edits shortcuts
Sources/SnapText/SettingsView.swift - App Coordinator → Persistent Preferences: loads settings
Sources/SnapText/AppDelegate.swift - App Coordinator → Launch At Login: toggles
Sources/SnapText/AppDelegate.swift - Mac User → Screen Selection: selects region
README.md - Mac User → History Search Panel: searches history
README.md - Screen Selection → macOS Services: requests screen access
README.md