Skip to content

Instantly share code, notes, and snippets.

@freeyoung
Forked from cheeaun/ocr.sh
Created July 16, 2022 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freeyoung/c3d341ea7caf78a485ff9f62ca676826 to your computer and use it in GitHub Desktop.
Save freeyoung/c3d341ea7caf78a485ff9f62ca676826 to your computer and use it in GitHub Desktop.
macOCR script for Raycast. Preview https://twitter.com/cheeaun/status/1395973544983425025
#!/bin/bash
# Dependency: requires macOCR
# Download: https://github.com/schappim/macOCR
# @raycast.schemaVersion 1
# @raycast.title macOCR
# @raycast.mode silent
# @raycast.author Lim Chee Aun
# @raycast.authorURL https://github.com/cheeaun
# @raycast.description Get any text on your screen into your clipboard
# @raycast.packageName macOCR
# Optional parameters:
# @raycast.icon 📸
# @raycast.argument1 { "type": "text", "placeholder": "language", "optional": true }
### Language codes:
# Bulgarian: bg
# Chinese simplified: zh
# Czech: cs
# Danish: da
# Dutch: nl
# English (American and British): en
# Estonian: et
# Finnish: fi
# German: de
# Greek: el
# Hungarian: hu
# Italian: it
# Japanese: ja
# Latvian: lv
# Lithuanian: lt
# Polish: pl
# Portuguese (Brazilian and Portuguese): pt
# Romanian: ro
# Russian: ru
# Slovak: sk
# Slovenian: sl
# Spanish: es
# Swedish: sv
# Configure your default language code here:
toLang=$1
args=
if [ -n "$toLang" ]; then
args="-l $toLang $args"
fi
ocr $args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment