It's possible to use this package with Sharex to OCR images using Google Lens API, instead of bad default OCR in Sharex. Here's how to do it:
- Get Sharex if you don't have it already.
- Install Node.js LTS from https://nodejs.org/en (make sure to check "Add to PATH" during installation)
- Download this repo somewhere safe and extract it
- Go to the extracted folder and Shift+Right Click -> Open PowerShell window here
- Run
npm install
and wait for it to finish - Now open Sharex window and go to Hotkey settings and create a new hotkey for "Capture region (Light)". Then open that hotkey setting menu and set Task like this:
- Now go to Actions and check "Override actions", then press Add... and set it up like this:
Except instead of
D:\Node.js\node.exe
you should put the path to your Node.js installationD:\JS\ChromeLensApi\
part you should put the path to the extracted folder (withsharex.js
part included at the end).
- Save it, and make sure "lens" is checked. Now you can close the settings and setup the hotkey to your liking.
- Now you can use your hotkey to capture a region and it will OCR it using Google Lens API (once it shows screenshot on your screen, text should be copied to your clipboard).
If it takes a long time to show image and at the end doesn't copy anything for you, there might be some error happening in sharex.js
script. You can turn off "Hidden window" in "lens" Action settings and run the hotkey again to see the error.
If there was an update to this repo, you can just download the new version and replace the old one. You can also run git pull
in the folder if you have git installed.