littlebigman Posted June 25, 2012 Share Posted June 25, 2012 Hello I'm an AutoIT newbie, and need to select an item in a combobox. I googled for this, but would like to check what's the right way to solve this. The combobox control I need to click on and select an item from is class=TbsSkinOfficeComboBox. Should I use this, or is there a better way? ;Which should I choose? #include <GUIConstantsEx.au3> GUICtrlSetState("TbsSkinOfficeComboBox",$GUI_FOCUS) ;or ControlCommand("My GUI", "", "[CLASS:TbsSkinOfficeComboBox; INSTANCE:1]", "SelectString", "item2") Thank you. Link to comment Share on other sites More sharing options...
littlebigman Posted June 26, 2012 Author Share Posted June 26, 2012 (edited) I made a bit of progress understanding how AutoIT works with controls, but the following code doesn't work: The script just waits doing nothing, although the application is running with its window maximized: #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- _WinWaitActivate("classname=TfrmHome","") ControlClick("[CLASS:TfrmHome]", "", "[ID:2164966]") Can someone spot what's wrong with the above? Thank you. Edited June 26, 2012 by littlebigman Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 26, 2012 Share Posted June 26, 2012 I think it's waiting (and will be waiting until the end of time) for a window with this title: classname=TfrmHome. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
littlebigman Posted June 26, 2012 Author Share Posted June 26, 2012 (edited) Thanks for the help. I found what it was: The following code as generated by Au3Recorder doesn't work: _WinWaitActivate("classname=TfrmHome","",5) This works: ;time out after 10s ;BAD _WinWaitActivate("classname=TfrmHome","",5) _WinWaitActivate("[CLASS:TfrmHome]","",5) Send("{ALTDOWN}a{ALTUP}") MsgBox(64, "My title", "My text") Bottom line: Although it should be a great help for newbies to get started with AutoIT, Au3Recorder is to be avoided. Thank you. Edited June 26, 2012 by littlebigman Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 26, 2012 Share Posted June 26, 2012 Thanks for the help.You bet. Good luck with the rest of your project. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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