Move mouse to text on screen (OCR) Action(Power Automate Desktop)

07/21/2023

Japanese version.

The action is to find the specified text and move the mouse to that location.

You can optionally make it click.

This action is useful when the "Mouse move" action does not work well.

How to use

Drag "Move mouse to text on screen (OCR)" from "Mouse and Keyboard" under "Actions".

Set parameters.

Parameter

OCR engine type

The "Windows OCR engine" has more languages that can be used, so this is basically recommended.

  • Windows OCR engine
  • Tesseract engine

Text to find

Specify the text that will be used as the mouse move position.

Is regular expression

When turned ON, "Text to find" is treated as a regular expression.

There are a wide variety of regular expressions, but the following are typical ones that are used frequently.

As an example, the string "aB1C2dE" is parsed.

Regular expressionDescriptionResult
[0-9]Numerical value12
[a-zA-Z]AlphabetaBCdE
B.*2Starts with a "B" and ends with a "2".B1C2

Occurrence

Specifies how many times to move to the found text.

Adjust this item if the target text occurs more than once.

If it is not found for that number of times, an error is generated.

Search for text on

Specify whether to search the entire image or only the active window.

The larger the search area, the higher the probability of a match, but the slower the operation.

  • Entire screen
  • Foreground window only

Search mode

When a sub-area is specified, the position is also specified in X and Y coordinates.

  • Whole of specified source
  • Specific sbregion only
  • Subregion relative to image

A narrower search is possible.

Moves mouse from previous position

Select the speed of mouse movement.

Windows OCR language

This is the language setting when the "OCR engine type" is "Windows OCR engine".

Use other language

"Tesseract Engine" setting.

Turn ON if you want to use languages other than English, German, Spanish, French, or Italian.

Language abbreviation.

"Tesseract Engine" setting.

Set this if "Use other language" is ON.

Select the code from "Lang Code" here.

Language data path

"Tesseract Engine" setting.

Set this if "Use other language" is ON.

Download the "<Lang Code>.traineddata" and "<Lang Code>_vert.traineddata" files.

Specify the directory where the two files are stored.

For example, "jpn.traineddata" and "jpn_vert.traineddata" in Japanese.

Tesseract language

This is the setting for the "Tesseract engine".

If "Use other language" is ON, this parameter is not displayed.

  • English
  • German
  • Spanish
  • French
  • Italian

Image width multiplier/Image height multiplier

Adjust for high-resolution images and screens.

Wait for text to appear

If ON, waits a specified number of seconds for no text to be found.

If OFF, it will not wait and an error will occur.

Fail if text doesn't appear within

Displayed when "Wait for text to appear" is ON.

The number of seconds to wait for the text to be found.

Send a click after moving mouse

Change to ON if you want the click to occur after the move.

Click type

Displayed when "Send a click after moving mouse" is ON.

Wait before clicking for

Displayed when "Send a click after moving mouse" is ON.

Mouse position relative to text

Select the destination position from upper left corner, upper center, upper right corner, left center, center, right center, lower left corner, lower center, lower right corner.

Offset X, Y

Adjusts the destination in pixels.

Variables produced

LocationOfTextFoundX, LocationOfTextFoundY

The X and Y locations of the search result are stored.

WidthOfTextFound, HeightOfTextFound

The width and height of the search result are stored.

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

Mouse and Keyboard Actions