In macOS it's possible to use the "nice" command to lower the priority of a task. Can I do something similar with a KM macro, or perhaps with a single action in a KM macro?
I do a lot of OCR and Find Image, but sometimes they bog down the responsiveness of the macOS GUI, and I would prefer high responsiveness over the speed of these tasks.
Alternatively, is there some other macOS command line utility (or even a third party utility) which can perform the same "Apple OCR", (like there is with "screencapture") because if there is, I can use the "nice" command to get the OCR to work at a lower priority. Hmm, I just googled it, and there's something called OWL OCR which might fit the bill. (It's on the Apple App store, and advertises itself as a GUI app, but comes with a command line version.) I just tried it out. It can read either from a file or directly from the screen, but if you read from the screen, it has to be the whole screen and not some portion of it. That's helpful, for many situations, but not perfect.
Alternatively, does AppleScript allow us to run something in a lower priority? If so, maybe I could run a KM macro from AppleScript with a lower priority. I tried googling this idea, but it was difficult.
May I make a feature request that the Execute Macro action have a new feature that lets us "lower the priority" of the macro when it runs? This would also solve my problem. It doesn't sound too difficult to implement. (as anyone would say for any feature request)
For those who want to know, here are the options for the OWL OCR command line app: (it's free for 3 weeks, then costs just $10 for a lifetime license, although I'm not sure if the command line will work in its free mode.)
OwlOCR Command Line Interface
---------------------------------
Inputs:
------
- Use with files --input /path/to/filename.jpg or screenshot using --screenshot.
- Screenshots require screen recording permissions to the terminal application or other application where you are launching OwlOCR CLI from.
Output:
------
- OCR results are printed to stdout, unless called with --silent.
- To export a PDF file use --output /path/to/newPdfFile.pdf.
Example 1, capture area of screen and get text to stdout:
--------------------------------------------------------
/Applications/OwlOCR.app/Contents/MacOS/OwlOCR --cli --screenshot
Example 2, convert image file to searchable PDF:
-----------------------------------------------
/Applications/OwlOCR.app/Contents/MacOS/OwlOCR --cli --input myimage.jpg --output mypdf.pdf --silent
Notes:
------
Full list of supported parameters are: --cli --screenshot --input --i --output --o --silent --force --silence-notifications --show-dock
--cli is always required to start command line operation. It is a safety precaution for the GUI users to not inadvertently open CLI.
Bugs, feature requests, or support requests -> support@owlocr.com.