As of macOS Monterey it is possible to select text in images in Preview.
Is this OCR functionality available from AppleScript and/or JXA (JavaScript for Automation)?
In Script Editor.app File > Open dictionary... I selected the Preview.app and looked at the API for Standard Suite and Text Suite but there doesn't seem to be anything related to OCR. (The Text Suite apparently has to do with drawing text on picture and not text extraction.)
I have also searched for text recognition actions in Automator.app but didn't see anything suitable.
