RichardFromOz Posted September 12, 2006 Posted September 12, 2006 Hi Gurus, I am brand new to AutoIT and I'm hooked already, but I need a kickstart. The script I am writing will install and run various programs. CCleaner (www.ccleaner.com) is an example. However, I am getting stuck on 2 things: 1. When I run the program it runs for an indeterminate time, anything from 1 second to a minute before producing output in a listview control on the same window. How do I set the script to wait till the output appears? 2. I am using the gettext method to try and grab the output from the listview control and put it in my own list control, but this does not seem to work. The info tool identifies the listview control as syslistview321. I would appreciate any help. Test code is attached Thanks, RichardFromOZCCleaner.au3
Zedna Posted January 13, 2007 Posted January 13, 2007 Bit late I know but here is concept (not tested): Run("c:\program files\ccleaner\ccleaner.exe") WinWaitActive("CCleaner","") ControlClick("CCleaner", "", 2) ;run cleaner ;~ Sleep(5000) While ControlListView("CCleaner", "", "SysListView321",'GetItemCount') = 0 Sleep(100) WEnd ControlListView("CCleaner", "", "SysListView321", "SelectAll") ControlListView("CCleaner", "", "SysListView321", "Deselect", 2, 5) ;~ MsgBox(0, "", ControlListView("CCleaner", "", "SysListView321", "GetText", 9, 0) ) ;~ MsgBox(0, "", ControlListView("CCleaner", "", "SysListView321", "FindItem", "CLEANING COMPLETE", 1) ) ;~ MsgBox(0, "", ControlListView("CCleaner", "", "SysListView321", "GetSelected", 1) ) While ControlListView("CCleaner", "", "SysListView321", "FindItem", "CLEANING COMPLETE", 1) = -1 Sleep(100) WEnd $var1 = ControlListView("CCleaner", "", "SysListView321", "GetText", 9, 0) _GUICtrlListInsertItem($List1, $var1, -1) Resources UDF ResourcesEx UDF AutoIt Forum Search
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