Returns text found using OCR in a specified region, window, or control. Use to convert graphical text in an application to text strings for use in other statements. See Using OCR to Work with Graphical Text.
Syntax
OCRGetText(LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight)
Arguments
Argument | Description |
---|---|
LeftEdgePixel | Optional integer pixel value of the left side of the rectangle that contains the text to return. If not specified, all text in the window or control is returned. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argument is specified. |
TopEdgePixel | Optional integer pixel value of the top side of the rectangle that contains the text to return. If not specified, all text in the window or control is returned.Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified. |
RectangleWidth | Optional integer pixel value of the width of the rectangle that contains the text to return. If not specified, all text in the window or control is returned. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified. |
RectangleHeight | Optional integer pixel value of the height of the rectangle that contains the text to verify. If not specified, all text in the window or control is returned. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified. |
Return value
Value | Description |
---|---|
Value | Text found using OCR. |
Supported objects
Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window
Example
'Gets the password text HTML element and sets it in the Password field
password = Window("WysiCorp Home").HTMLElement("elementLoginTester").OCRGetText(80, 31, 61, 17)
Window("WysiCorp Home").EditBox("editboxPassword").SetText(password)