Skip to content

Instantly share code, notes, and snippets.

@mrflobow
Created August 9, 2022 07:25
Show Gist options
  • Save mrflobow/3f40d34b34d1f9748b61e2f827c6145f to your computer and use it in GitHub Desktop.
Save mrflobow/3f40d34b34d1f9748b61e2f827c6145f to your computer and use it in GitHub Desktop.
Hazel - Trigger OCRKit
#!/bin/zsh
ocrkit=/Applications/OCRKit.app/Contents/MacOS/OCRKit
filename=$(basename -- "$1")
new="/Users/YOURUSER/Scans/OCR/$filename"
$ocrkit --lang de --format pdf --no-progress --output "$new" "$1"
if [ $? -eq 0 ]; then
echo "OK"
echo "Remove $1"
rm "$1"
else
echo "FAIL"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment