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
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
objElement | True | element | @ 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 |
objRect | True | dictionary | {"x":0,"y":0,"width":0,"height":0} | Recognition range, specifying the rectangular recognition range within the window where the target is located |
sApiKey | True | string | empty string | API Key, Please copy the API Key from Credentials on Google Cloud Platform |
iTimeOut | True | number | thirty thousand | Timeout 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)