Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions commands/conversions/clipboard-ocr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Dependency: `brew install pngpaste tesseract`
# pngpaste required to grab image from clipboard
# tesseract required to OCR

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title OCR Image
# @raycast.mode fullOutput

# Optional parameters:
# @raycast.icon 📋
# @raycast.packageName Clipboard

# Documentation:
# @raycast.description OCR Image from Clipboard
# @raycast.author xxchan
# @raycast.authorURL https://github.com/xxchan

# credit to @laixintao https://www.kawabangga.com/posts/4876

pngpaste - | tesseract stdin stdout
21 changes: 21 additions & 0 deletions commands/system/open-image-from-clipboard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Dependency: `brew install pngpaste coreutils`
# pngpaste required to grab image from clipboard
# coreutils required to create temp file with suffix

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open Image
# @raycast.mode compact

# Optional parameters:
# @raycast.icon 📋
# @raycast.packageName Clipboard

# Documentation:
# @raycast.description Open Image from Clipboard in Preview for OCR or other purposes.
# @raycast.author xxchan
# @raycast.authorURL https://github.com/xxchan

tempfile=$(gmktemp --suffix=.png) && pngpaste $tempfile && open $tempfile