Using Capture window action
Use the Capture window action to extract text from an application window. You can filter the extracted text and assign it to a string variable.
Follow these steps to use the Capture window action:
- In the Actions palette, double-click or drag the Capture window action from the OCR package.
In the Window title field, select an option:
- Window: Captures a window on a desktop. In the Window title field, specify the application title.
- Variable: Inserts an existing window variable. Click Variable tab to create a new string variable.
Insert a wildcard character (*) in the Window title field to search for window titles that can change. You can specify one or more wildcards (*) at the start, middle, or end of the value. For example, to perform an operation on any window that has Microsoft in the title, use a wildcard to indicate any string by adding it before or after the value: *Microsoft*. The bot first searches for the exact window title (Microsoft), and if it does not find a match, it searches for windows with the term Microsoft anywhere in the title.
You can use a regular expression (regex) to identify a window title. Select the regular expression either as a String or Pattern for each regular expression condition and enter the value. By default, the Window title field is case-sensitive. You can enable Case insensitive regex flag to identify a window title that is not case-sensitive.
For example, you can enter the String value as ((\w*)-Notepad for all the window title names starting with
((\w*)-Notepad, or use Pattern such as ((\w)\s)*document-Notepad for only those window titles that match this pattern.
Select the Resize window option to specify the window
This option delivers a more reliable bot. It resizes the window to the dimensions at which the task was recorded, which enhances the bot's ability to identify the target object.
Note: This option is only available for windows that can be resized. It is not available for the Desktop or Taskbar options.
- If the window is maximized when you record the task, this option is unselected.
- If the window is not at the maximum size when you record the task, this option is selected by default and the width and height fields auto-fill with the window dimensions.
In the Wait before capturing the image (ms) field, specify
the delay time.
Recommendation: If you are capturing in a window that is accessed using Remote Desktop Protocol (RDP), set a minimum delay time of 1000 milliseconds to give the window time to load.
Select the Filter the captured text check box to filter the
Specify the text to filter out in the Before and After fields. For example, if the extracted text is Name: ABC Inc. Location:, to retrieve ABC Inc., you must specify Location: in the Before field and Name: in the After field.
- Select the Trim the captured text check box to trim the extra spaces.
Select the Load Profile check box and select an option to
load the locale based on the ABBYY profile:
Note: ABBYY FineReader 220.127.116.11 is installed along with A2019 and does not require any additional setup.
- Control Room file: Uses a file that is available on the Control Room.
- Desktop file: Uses a file that is available on a device.
- Variable: Uses a file variable to specify the file location.
In the Select locale list, select the language of the
Note: Currently, only English and Japanese locales are supported. If you have selected an option from the Select locale list and the Load Profile option, the system considers the locale based on the Load Profile selection.
- In the Assign value to variable list, select a string variable.
- Click Save.