DGClarke1 Posted March 2, 2012 Share Posted March 2, 2012 I am using Autoit for the first time, and it looks great, really easy to use - BUT I am writing a script to start an application, login and click a link on a page. This is not a web application. I have no problems up to the point where I click the link. Clicking it simply doesn't work. Autoit v3 Window Info describes the control like this: Class Static Instance 1 ClassnameNN Static1 Name Advanced Mode [CLASS:Static ; INSTANCE 1] ID 10000 Text Work Orders ...other junk which I doubt will be useful I can use ControlGetText to get the text of the link (control), but ControlClick doesn't do the business. $name=ControlGetText("Window Name","Window Text","[iD:10000]") and sure enough "Work Orders" is returned, but ControlClick("Window Name","Window Text","[iD:10000]") does not appear to do anything. Is there another "click" function I should be using for this type of control? I would really appreciate any advice that can be given. Thanks Link to comment Share on other sites More sharing options...
DW1 Posted March 2, 2012 Share Posted March 2, 2012 Maybe controlsend() will work for it? ControlSend("Window Name","Window Text","[ID:10000]",'{space}') AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DGClarke1 Posted March 2, 2012 Author Share Posted March 2, 2012 Just tried that and the effect was the same. The link didn't get clicked. Thanks for replying though. I'll take ANY suggestions. Link to comment Share on other sites More sharing options...
DW1 Posted March 2, 2012 Share Posted March 2, 2012 I'll take ANY suggestions. In that case, either of these work? ControlSend("Window Name","Window Text","[ID:10000]",'{enter}') $hWND = WinGetHandle ("Window Name") $hControl = ControlGetHandle ($hWND, "", "[ID:10000]") ControlClick ($hWND, "", $hControl) AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DGClarke1 Posted March 2, 2012 Author Share Posted March 2, 2012 WhoooHoooYou are a STAR!!!ControlSend("Window Name","Window Text","[iD:10000]",'{enter}')Worked a treat. Thanks very much for taking the trouble to reply/Dave 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