ToeKnee Posted March 27, 2006 Share Posted March 27, 2006 Hello, Just found Autoit a month ago. Very cool. I'm trying to install SAP using it. I have it doing everything including running a BAT file at the end (thank you forum). But when I run this on some machines, at the end of the install, they get a windows titled SAPinstall (text says something about you must restart). Because of this window, my script stops waiting for the next window. If I add WinWaitActive it works but then I run into a circle. Because some computers do not get the restart window. So in short, how to I make AutoIt answer a window but only if that window comes up? Thanks, Tony Link to comment Share on other sites More sharing options...
herewasplato Posted March 27, 2006 Share Posted March 27, 2006 Look in the help file under AdlibEnable... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
ToeKnee Posted March 27, 2006 Author Share Posted March 27, 2006 Wow, that was a fast response. That looks exactly what I'm looking for. I have one queston at that though. Looking at the help, They had two parts. One to call a function and one to create it. Is this correct (I'm coming from that days of Basic and Fortan). So do I need both parts or just the first part and not creat a function? Also their example didn't have a timer when to check. Is this needed? Can you just do AdlibEnable for 1 window or can I have several Adlib? AdlibEnable("SurpiseWin") ;... Exit Func SurpiseWin() If WinActive("Error") Then ControlClick ("Error", "There was an error", Button1) EndIf EndFunc Link to comment Share on other sites More sharing options...
Bert Posted March 27, 2006 Share Posted March 27, 2006 You can also do a winwaitactive with a timeout. WinWaitActive ( "title" [, "text" [, timeout]] ) The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
herewasplato Posted March 27, 2006 Share Posted March 27, 2006 (edited) yes... both parts are needed - I would use WinExists:Func SurpiseWin() If WinExists("Error") Then ControlClick("Error", "There was an error", Button1) EndFunc;==>SurpiseWinTimer - or how often AdlibEnable is to check (run) is here:AdlibEnable ( "function" [, time] )time is [optional] how often in milliseconds to call the function. Default is 250 ms.Check for as many windows as you like within one adlib function or create as many adlib functions as you would like and enable/disable them thru-out your code.Edit: Welcome to the forums...Edit2: Wish I could tyype/spelllle Edited March 27, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] 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