Getting Text from an Application Running in Citrix

You can capture text from an image in a remote Citrix session.

To get text from the specified window (Win32 Form), you can use two methods by using different OCR functions:

Initialize the Picture object using the Create from Window function, and then get the text using the Get Image Text function.

This method is explained the procedure below.

Create a Picture and get the text with the Recognize Text from Control function.

You can also get text from OCR text blocks. In this case you must create a Picture and use the Get OCR Text Block function. To get the amount of OCR blocks, use the Block Count property of the Picture.

To capture text from a remote application running in a Citrix session:

1. Open a Citrix session and run a test application.

2. Capture the ICA client window. A Win32 Form screen element is captured.

3. In the Business Entity tab, create a new Business Entity type.
4. Create an instance of New Type.

5. Add a New Property to the New Type and give it a name (Picture object in the example).
6. In the Properties tab, open the Property Type drop-down list, and select Library Objects > General > Picture.

7. Under the New Type, add a New Function, and give it a name (Get Text in the example).
8. In the Function Body section, select Insert Instruction > Select Function > Picture Object > Create from Window.

9. Click the <Select Window Handle…> link and select a window handle of the captured Win32 Form screen element (Screen Elements > wfica32 > TRANSPARENT WINDOWS CLIENT - AnySoft Wrapper Controls Test Application v1.0 > Window Handle).

10. Under the New Type, add a new property of the Text type and give it a name (Text in the example).

11. Select the Get Text function under the New Type, and in the Function Body section, select Insert Instruction > Assignment. Then, click the <Select Object…> link and select Text property.

12. Click <Enter Value…> and select Picture Object > Get Image Text.

13. To test the previous steps, click the Presentation tab and add a New Blank Callout.
14. In the New Callout, add the link to the Get Text function, and insert dynamic text with the assignment to the Text business entity property.

15. In the Project tab, apply the New Callout to a Quick callout.

16. Save and run the project. Make sure that the test application is running in the Citrix session.
17. Open the Quick callout.

Make sure Real-Time Client with the callout is not covering the test application.

Click the Get Text link. The text from the UI of the test application is displayed in the callout.