diff --git a/commands/conversions/clipboard-ocr.sh b/commands/conversions/clipboard-ocr.sh new file mode 100755 index 000000000..3d314879e --- /dev/null +++ b/commands/conversions/clipboard-ocr.sh @@ -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 diff --git a/commands/system/open-image-from-clipboard.sh b/commands/system/open-image-from-clipboard.sh new file mode 100755 index 000000000..affb7cdc1 --- /dev/null +++ b/commands/system/open-image-from-clipboard.sh @@ -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