Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
) | plutil -convert binary1 - -o - | xxd -p | tr -d '\n')
xattr -w -x "$hex" "$1"
mdimport "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment