Get text from window

更新时间:
复制 MD 格式

1. Component introduction

Note

Prerequisite component: Get window

Use this component to retrieve text from a specific element in a window of a Windows application.

2. Inputs

Note

For more information about each input, see the help text in the component panel of the ROS Visual Editor.

3. Outputs

Note

For more information about each output, see the help text in the component panel of the ROS Visual Editor.

4. Component usage examples

4.1. Example configuration

  1. For Window object, select v_win_obj_1, which is the output of the prerequisite Get window component.

  2. Use the Capture control feature to capture a text element in the window. Name the captured control 'Control 1'.

  3. For Target control, select 'Control 1'.

4.2. Example result

The text from the window element is successfully retrieved and saved to the default variable v_win_element_text_1.

5. Example flow

Setup flow

  1. Create and open a Word document named 'New Microsoft Word Document'.

  2. Use the Get window component to obtain the 'New Microsoft Word Document' window.

  3. Use the Capture control feature to capture the 'Insert reference folder' element in the Word document, as shown in the following figure.Dingtalk_20220810164658

  4. Use the Get text from window component and select the captured control.

  5. Use the Record log component. Set the log type to Info. For the log content, use the output variable from the Get text from window component.

Result

As shown in the following figure, the flow successfully captures the text from the window element and records it in the log panel of the Robotic Process Automation (RPA) editor.