schappim / macOCR

Get any text on your screen into your clipboard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improvements

TonioGela opened this issue · comments

It will be great to have a help menu using -h and the possibility to pass an image file from command line like ocr my_image.png

commented

This PR has the first part.
#2

Add the second! :)

Thanks for the speedy PR @adam-zethraeus . I’m currently in bed about to fall asleep. Will review first thing tomorrow.

@adam-zethraeus just noticed that the target is now macOS 11 due to the use of the Scene (guessing SwiftUI).

I'm not sure this is necessary for a CLI first app. Thoughts?

commented

🤔 sounds very unnecessary

commented

Oh it does target 11. No use of scene or 11-oriented APIs though, it's just the platform I'm on. Sorry!
Feel free to grab from by fork and change the API target if you'd like! I made more changes to accept stdin (and to remove the pasteboard functionality—pbcopy is fine for me!).

fork: https://github.com/adam-zethraeus/macOCR

behavior:

❯ ocr --help
USAGE: ocr [--capture] [--stdin] [-i <i>]

OPTIONS:
  -c, --capture           Capture screenshot.
  -s, --stdin             Read stdin binary data.
  -i <i>                  Path to input image.
  -h, --help              Show help information.

Another option that would be really useful - and help in Alfred workflows etc

ocr --clipboard
Use image or path to image from clipboard.

Suggested:

❯ ocr --help
USAGE: ocr [--capture] [--stdin] [-i <i>]

OPTIONS:
  -b, --clipboard	Use image or path from clipboard
  -c, --capture		Capture screenshot.
  -s, --stdin		Read stdin binary data
  -i <i>			Path to input image.
  -h, --help 		Show help information.

Another way would be ocr --source <clipboard|capture|path> [url|-] with default being capture (for compat). Stdin can just be the special path '-'.