Skip to main content
Version: v6.5.0

Screen OCR recognition

Command Description

Use the OCR identification screen to specify the range. When calling, you need to access the Internet

Command Prototype

sText = GoogleOCR.ScreenOCR(objElement,objRect,sApiKey,iTimeOut)

Command parameter

parametermandatorytypedefault valueInstructions
objElementTrueelement@ ui""Target, select or capture the target screen range that needs to be recognized through the mouse, including information such as windows, elements, and ranges
objRectTruedictionary{"x":0,"y":0,"width":0,"height":0}Recognition range, specifying the rectangular recognition range within the window where the target is located
sApiKeyTruestringempty stringAPI Key, Please copy the API Key from Credentials on Google Cloud Platform
iTimeOutTruenumberthirty thousandTimeout time (in milliseconds), specifying the waiting time (in milliseconds) for retry search of screen range. If this time is exceeded, an exception will be raised. Default 30000 milliseconds (30 seconds), maximum timeout is 1000000 milliseconds

Return result

SText, Assign the result of running the command to this variable

Run instance

/**************************Screen OCR Recognition**************************
Command prototype:
sText = GoogleOCR.ScreenOCR(objElement, objRect, sApiKey, iTimeOut)
Input parameters:
objElement -- Target. Select or capture the target screen area to be recognized via mouse, including window, element, range and other information.
objRect -- Recognition range. Specify the rectangular recognition range within the window where the target is located.
sApiKey -- API Key. Note: Please copy the API Key from Credentials on Google Cloud Platform.
iTimeOut -- Timeout (in milliseconds). Specify the time (in milliseconds) to wait for rechecking the screen range. If this time is exceeded, an exception will be thrown. The default is 30000 milliseconds (30 seconds), and the maximum timeout is 1000000 milliseconds.
Output parameters:
--> None
Notes:
None
******************************************************************/

sText = GoogleOCR.ScreenOCR(objElement,objRect,sApiKey,iTimeOut)