Jump to content

issue with selecting menu item and edit box content.


Recommended Posts

 
I am trying to automate basic functionality on freeOCR.
 
I am  using below code to select a menu item:
 
WinMenuSelectItem ( "FreeOCR", "", "File", "Open")
 
It is not working.
 
 
Simillarly I am using below code to get text from an edit box.
 
 
$value = ControlGetText ( "FreeOCR", "", "[CLASS:Edit; INSTANCE:1]")
 
 
 
Could any one please assist.
 
Regards,
Ravi
9490422779
Link to comment
Share on other sites

Hi,

Try this:

Local $hWnd = WinGetHandle("FreeOCR")

ConsoleWrite(ControlGetText($hWnd, "", "[NAME:TextBox1]") & @CrLf)

;Note: The window's menu is customized and can not be manipulated otherwise than Mouse* functions.
WinActivate($hWnd)
WinWaitActive($hWnd)

Local $aWndPos = WinGetPos($hWnd)

MouseClick("left", $aWndPos[0] + 30, $aWndPos[1] + 40, 1, 0)
MouseClick("left", $aWndPos[0] + 30, $aWndPos[1] + 60, 1, 0)

Local $sFilePath = "image.bmp"

ControlSetText("Select Image to OCR", "", "[CLASS:Edit; INSTANCE:1]", $sFilePath, 1)
ControlClick("Select Image to OCR", "", "[CLASS:Button; INSTANCE:1]")
Edit: Welcome to the autoit forum :)

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...