forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add open image from clipboard & clipboard OCR (raycast#813)
* add open image from clipboard * add clipboard-ocr * resolve comments
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |