# OCR on Windows in FileMaker

**URL:** <https://the.fmsoup.org/t/ocr-on-windows-in-filemaker/3368>\
**Category:** MBS Plugins\
**Tags:** scripting, plugin, windows\
**Created:** [February 8, 2023, 7:20am UTC](https://the.fmsoup.org/t/ocr-on-windows-in-filemaker/3368 "2023-02-08T07:20:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [February 8, 2023, 7:20am UTC](https://the.fmsoup.org/t/ocr-on-windows-in-filemaker/3368/1 "2023-02-08T07:20:33Z")

</div>

Did you know that Windows 10 has a built-in OCR engine?

For [MBS FileMaker Plugin](https://www.monkeybreadsoftware.com/filemaker/) 13.1 we add new [WindowsOCR](https://www.mbsplugins.eu/component_WindowsOCR.shtml) functions. These functions allow the plugin on Windows 10 to use the built-in OCR classes and expose them as functions to you in FileMaker. This was made possible by dropping Windows 7 support, so we can now use the functionality from Windows 8 to use these classes. Although if you call them on Windows 8, they will return an error. Please use [WindowsOCR.Available](https://www.mbsplugins.eu/WindowsOCRAvailable.shtml) in your script to check whether it returns 1.

Once you know you run on Windows 10 (or 11), you can check the available languages with [WindowsOCR.AvailableRecognizerLanguages](https://www.mbsplugins.eu/WindowsOCRAvailableRecognizerLanguages.shtml) function. This function can return you the list of languages with either display name (in user's language), language tag or the name within the language itself. e.g. "German" vs. "Deutsch". You can use our [WindowsOCR.CurrentInputMethodLanguageTag](https://www.mbsplugins.eu/WindowsOCRCurrentInputMethodLanguageTag.shtml) function to query what language the user has for the current method of input. The user may have multiple languages installed, but this one is used when you create a recognizer without specifying the language.

![](https://www.mbs-plugins.com/image/Windows-OCR-FileMaker.jpg)

In your script you call [WindowsOCR.New](https://www.mbsplugins.eu/WindowsOCRNew.shtml) function to create a new recognizer and get the reference number for the recognizer object. You can create several recognizer for different languages in parallel and you may create them once and then keep them around until FileMaker quits. Various scripts may use them to recognize them. For server scripts, we recommend to make a new recognizer in a script and release it on the end of the script, so parallel running scripts don't try to touch the same one at the same time, which could lead to trouble.

Once you got the recognizer, you can let it recognize either images from a file or container. Pass a native file path to [WindowsOCR.RecognizeFile](https://www.mbsplugins.eu/WindowsOCRRecognizeFile.shtml) or your container via variable or field to [WindowsOCR.Recognize](https://www.mbsplugins.eu/WindowsOCRRecognize.shtml) function. If it returns OK and no error, you can query the result. Both functions should do fine with various file formats like JPEG, TIFF, GIF, PNG, HEIF or BMP supported by Windows. The maximum size of such an image is 10000 by 10000 pixels.

After the recognition finished, you can query the text with [WindowsOCR.Text](https://www.mbsplugins.eu/WindowsOCRText.shtml) function and the angle of that text with the [WindowsOCR.TextAngle](https://www.mbsplugins.eu/WindowsOCRTextAngle.shtml) function. The [WindowsOCR.Result](https://www.mbsplugins.eu/WindowsOCRResult.shtml)function returns you a JSON with all the details on the result including where individual words are located.

As we added the [WindowsOCR](https://www.mbsplugins.eu/component_WindowsOCR.shtml) functions, we also updated [Vision.RecognizeText](https://www.mbsplugins.eu/VisionRecognizeText.shtml) and [Vision.SupportedRecognitionLanguages](https://www.mbsplugins.eu/VisionSupportedRecognitionLanguages.shtml) to work on Windows using these functions internally. So you have now one function similar to FIleMaker's LiveText function to recognize images on macOS, iOS and Windows. And since we worked with image functions from Windows, we implemented [Container.ReadImage](https://www.mbsplugins.eu/ContainerReadImage.shtml) and [Container.ReadImageFile](https://www.mbsplugins.eu/ContainerReadImageFile.shtml) functions on the way to read various images files like HEIF and convert them to JPEG or PNG.

Please try the new functions and don't hesitate to contact us with questions.
