feoinc Posted July 20, 2008 Share Posted July 20, 2008 Hello, I've been searching a bit the forums but I haven't seen any topic related. I am trying to automate an application, and when I send a ControlCommand to change the value of a ComboBox the application pops up a modal dialog that I want to close. However after doing the ControlCommand the script seems to hang and start using around 10% of CPU. The piece of code that is having problems is something like: AutoItSetOption ("WinTitleMatchMode", 2) ... ControlCommand("program", "", 1000, "SetCurrentSelection", 1); this is executed ; AutoIt hangs here If WinWait("Error", "Error Message", 0.5) = 1 Then Send("{ENTER}") EndIf I am on latest version (3.2.12.1) I've discovered that if I manually close the dialog the script stays in memory and further executions work fine. However leaving a zombie process eating 10% of CPU is not an option. muttley Link to comment Share on other sites More sharing options...
system24 Posted July 20, 2008 Share Posted July 20, 2008 (edited) Use Sleep(). See if it still uses 10% of the memory. Edited July 20, 2008 by system24 [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center] Link to comment Share on other sites More sharing options...
feoinc Posted July 20, 2008 Author Share Posted July 20, 2008 Use Sleep().See if it still uses 10% of the memory.The script hangs after ControlCommand(), it does not execute anything after that instruction. Link to comment Share on other sites More sharing options...
DW1 Posted July 20, 2008 Share Posted July 20, 2008 WinWait's timeout will not work with a timeout of .5 seconds, you must use a whole number here. Also maybe try using controlclick() or controlsend() instead of send() AutoIt3 Online Help Link to comment Share on other sites More sharing options...
system24 Posted July 20, 2008 Share Posted July 20, 2008 Sorry. [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center] Link to comment Share on other sites More sharing options...
feoinc Posted July 20, 2008 Author Share Posted July 20, 2008 WinWait's timeout will not work with a timeout of .5 seconds, you must use a whole number here.Also maybe try using controlclick() or controlsend() instead of send()The problem is that the script hangs before reaching the WinWait(), if I write there any code like MsgBox(0, "test", "test") nothing is displayed.My guess is that the script never returns from the ControlCommand because the application spawns the modal dialog and the control and window it was addressing is not the current active one. Link to comment Share on other sites More sharing options...
feoinc Posted July 20, 2008 Author Share Posted July 20, 2008 I've made around it adding other entry point to my script and calling myself using that other entry point to close the new modal dialog (I do not want to have 2 scripts around). It is dirty and obscure but it is the only way around it that I've been able to make work. Or does anyone know if AutoIT has any multi-thread/multi-process support? Thanks to all who replied. Cheers Link to comment Share on other sites More sharing options...
jdelaney Posted February 2, 2012 Share Posted February 2, 2012 (edited) That's unfortunate. I came across the same issue in my application...ControlCommand ( $sWebDomHandle, "", $otbActions, "SendCommandID", 36604 )When the script performs the above action (a logout action), the window closes, and a new window opens (logout)...until I manually close the new window, the script stalls.I saw other posts where a developer stated:...oh, the $otbActions handle is for a class = ToolbarWindow32 Edited February 2, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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