JonnySpec Posted September 13, 2010 Share Posted September 13, 2010 I am trying to automate a process. Below is the basic code for starting and clicking the first button" my issue is that the button does not click. I have looked at the manual (Standard RTFM first) but to no avail. any suggestions would be great . Thanks in advance. And now the code: run("C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\ImportWiz.exe") $handle = WinGetHandle("[CLASS:#32770]") WinActivate($handle) $chandle = Controlgethandle($handle,"",12324) WinActivate($handle) ControlSend($handle,"",$chandle,"!n",0) WinActivate($handle) Link to comment Share on other sites More sharing options...
wakillon Posted September 13, 2010 Share Posted September 13, 2010 Welcome to the forum !You forget winwait before winactivate ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JonnySpec Posted September 13, 2010 Author Share Posted September 13, 2010 (edited) Still a No-Go . Button is not clicking Updated Code: run("C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\ImportWiz.exe") $handle = WinGetHandle("[CLASS:#32770]") WinWait($handle) WinActivate($handle) $chandle = Controlgethandle($handle,"",12324) ControlSend($handle,"",$chandle,"!n",0) WinWait($handle) WinActivate($handle) Edited September 13, 2010 by JonnySpec Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 13, 2010 Share Posted September 13, 2010 (edited) You are still trying to get the handle, perhaps before it exists because you have WinGetHandle() BEFORE WinWait().Also, class #32770 is a very common dialog class, and there are probably more than one open at any given time (some hidden). You need to be more specific, like: WinWait("[CLASS:#32770; TITLE:Your Window Title Here]", "", 10) ; Wait max 10sec for window to appear $hWin = WinGetHandle("[CLASS:#32770; TITLE:Your Window Title Here]", "") If @error = 0 Then MsgBox(64, "Success", "Got window handle: " & $hWin) Else MsgBox(16, "Error", "Failed to get window handle!") Exit EndIf Edited September 13, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
wakillon Posted September 13, 2010 Share Posted September 13, 2010 And for click try controlclick or controlcommand... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JonnySpec Posted September 13, 2010 Author Share Posted September 13, 2010 And for click try controlclick or controlcommand...Thanks for the quick turn around.. adding the TITLE to the get handle solved the issue Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now