Skip to content

MiracleXYZ/obsidian-livetext-extractor

Repository files navigation

LiveText Extractor for Obsidian

Extract text from images using macOS LiveText OCR. Better Chinese support than Tesseract.

Features

  • 🖼️ Extract text from images using macOS native LiveText
  • 🇨🇳 Excellent Chinese/CJK support (much better than Tesseract)
  • 💾 Smart caching - re-processing only when files change
  • 🔌 Drop-in replacement for Text Extractor plugin
  • ⚡ Works with Omnisearch
  • 📱 Mobile support - Read cached text on mobile devices

Quick Setup

1. Create Shortcut (2 minutes)

  1. Open Shortcuts app
  2. Create new shortcut named LiveTextOCR
  3. Add these actions:
    • Receive Images from Share Sheet, Quick Actions
      • If there's no input: Continue
    • Extract text from → Shortcut Input
    • Combine Text from Image with New Lines
    • Stop and output Combined Text
      • If there's nowhere to output: Copy to Clipboard
  4. Important: In Details tab (right panel), check ✅ Provide Output
  5. Test with an image

2. Install Plugin

Manual:

  1. Download main.js, manifest.json, styles.css from releases
  2. Copy to <vault>/.obsidian/plugins/livetext-extractor/
  3. Reload Obsidian, enable in settings

Development:

cd <vault>/.obsidian/plugins/
git clone https://github.com/MiracleXYZ/obsidian-livetext-extractor.git
cd obsidian-livetext-extractor
npm install && npm run build

Usage

Desktop (macOS): Open image → Cmd+P → "Extract text from current image" → text copied to clipboard

Mobile: Can read cached text extracted on desktop. Omnisearch will find images indexed on desktop.

With Omnisearch: Install this plugin and disable Text Extractor. Omnisearch auto-detects!

API: See docs/API.md

const api = (app as any).plugins?.plugins?.['text-extractor']?.api;
const text = await api.extractText(imageFile); // Returns cached text on mobile

Settings

  • Shortcut Name: Shortcut to call (default: LiveTextOCR)
  • Enable Cache: Cache results (recommended)
  • Max Concurrent Tasks: 1-5 (default: 1 to prevent system lag)
  • Task Delay: 0-2000ms (default: 300ms, increase if Omnisearch causes issues)

Troubleshooting:

  • "Shortcut not found" → Create shortcut named LiveTextOCR
  • Slow/lag with Omnisearch → Set concurrent to 1, delay to 500-1000ms
  • No text → Test: shortcuts run LiveTextOCR --input-path image.png

Supported: JPG, PNG, GIF, BMP, TIFF, WebP, HEIC

Development

npm install && npm run build  # Setup
npm run dev                   # Watch mode

See docs/ for details.

License

MIT

About

An Obsidian (companion) plugin to extract text from images, utilizing Live Text on macOS.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors