OCR image and add text in comment field to file?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi, wondering if this is theoretically possible with Hazel…

On a folder, have a rule that passes the image to a bash script that OCRs it. Then take that output and insert it into the comment field in the file, so that it could be searched with Alfred or Spotlight.

Is that possible with Hazel?
947AB8
 
Posts: 2
Joined: Sun Oct 23, 2022 5:36 pm

Should be possible though most of that logic will be in the script. You could either set the comment in your script or export a custom attribute (you will have to use AppleScript for that) which you can then use in the Comment action. Check the manual on AppleScript for more details on how to do that.

I'm not sure, but there may be a max size for comments, though, so keep that in mind.

Also, if you OCR the file, it should be able to be scanned by Spotlight and searchable as is so adding a comment may be superfluous at that point.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron