MaxRussell Posted May 19, 2011 Share Posted May 19, 2011 Hi, I've been trying to do a small script to launch an application - I want it to select the program (fine), then click a radio button and a check box. However, I'm not getting anywhere with ControlGetHandle or ControlGetPos - I've read the documentation examples, but am seeing errors generated. #region ---Au3Recorder generated code Start --- ShellExecute("C:\PathToAPP\App.exe") Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) ;$hnd = ControlGetHandle("Title as it appears in window","","[CLASS:WindowsForms10.Window.8.app.0.378734a, INSTANCE:1]") $pos = ControlGetPos("[CLASS:WindowsForms10.Window.8.app.0.378734a]", "", "WindowsForms10.BUTTON.app.0.378734a") MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & $pos[2] & "," & $pos[3] ) however, the output in Scite is like this: C:\Documents and Settings\max.russell\Desktop\AutoItScript\launchGpa2SysTest.au3 (8) : ==> Subscript used with non-Array variable.: MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & $pos[2] & "," & $pos[3] ) MsgBox(0, "Window Stats:", "POS: " & $pos^ ERROR Is there a simpler way of doing this? many thanks Link to comment Share on other sites More sharing options...
wakillon Posted May 19, 2011 Share Posted May 19, 2011 Try If Not @error Then MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1] & $pos[2] & "," & $pos[3] ) A parameter may be wrong... 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...
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