Skip to content

Instantly share code, notes, and snippets.

@ryanfeeley
Created January 22, 2018 17:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanfeeley/7b451ac54b2f17151876387ba83e4b12 to your computer and use it in GitHub Desktop.
Save ryanfeeley/7b451ac54b2f17151876387ba83e4b12 to your computer and use it in GitHub Desktop.
Shell Script for macOS Automator Workflow to OCR Images to Set Finder Comments
for f in "$@"
do
/usr/local/bin/tesseract "$f" stdout | xargs -0 osascript -e 'on run {f, c}' -e 'tell app "Finder" to set comment of (POSIX file f as alias) to c' -e end "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment