simpleraison Posted December 3, 2010 Share Posted December 3, 2010 (edited) Hey guys quick question, im loving autoit so far learning lots and suprisingly excelled at it considering i have no experience in it at all. There is one thing i need some help on though, sometimes i process that is run displays a prompt box if a condition is met by the process, but a condition isn' always met by the process so the prompt box is not always displayed. I just wondered whats the best way for me to interact with the box if it appears if not carry on with the rest of the autoit script, is it a loop of somesort? Any help would be greatyl appreciated peeps! :-) Edited December 5, 2010 by simpleraison Link to comment Share on other sites More sharing options...
hannes08 Posted December 3, 2010 Share Posted December 3, 2010 Hi simpleraison, Do you mead sth. like If $condition = 1 Then MsgBox() EndIf Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
simpleraison Posted December 3, 2010 Author Share Posted December 3, 2010 Hi simpleraison, Do you mead sth. like If $condition = 1 Then MsgBox() EndIf Regards, Hannes This is the code i am using to currently: WinWaitActive("[CLASS:#32770]", "", 1000000000000000000000000000) ControlClick("", '', 'OK') So at the moment the code waits for the box to appear/active and then it clicks ok and moves on to the rest of the process. How do i encapsulate this with the code you provided?, so that this is only executed if the box appears and if it does not it just carries on, because as i said the box doesn't always appear only sometimes depending on the data. Link to comment Share on other sites More sharing options...
simpleraison Posted December 4, 2010 Author Share Posted December 4, 2010 This is the code i am using to currently: WinWaitActive("[CLASS:#32770]", "", 1000000000000000000000000000) ControlClick("", '', 'OK') So at the moment the code waits for the box to appear/active and then it clicks ok and moves on to the rest of the process. How do i encapsulate this with the code you provided?, so that this is only executed if the box appears and if it does not it just carries on, because as i said the box doesn't always appear only sometimes depending on the data. Any input on this peeps? Link to comment Share on other sites More sharing options...
JohnOne Posted December 4, 2010 Share Posted December 4, 2010 If WinExists("your title") Then ;your code Endif ;your other code AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
simpleraison Posted December 5, 2010 Author Share Posted December 5, 2010 If WinExists("your title") Then ;your code Endif ;your other code Thanks for this i think that it will work a treat, im just adding it to the code now! Dude how do i add a time into that for the script to wait before going into the then statement? I only want about 15 seconds as i know that box doesnt take that long to come up? Link to comment Share on other sites More sharing options...
simpleraison Posted December 5, 2010 Author Share Posted December 5, 2010 Thanks for this i think that it will work a treat, im just adding it to the code now! Dude how do i add a time into that for the script to wait before going into the then statement? I only want about 15 seconds as i know that box doesnt take that long to come up? Ok just added it like this: If WinWaitActive("[CLASS:#32770]", "", 10) then ControlClick("", '', 'OK') Endif So used WinWaitActive instead of WinExists! Does that look right John? Link to comment Share on other sites More sharing options...
JohnOne Posted December 5, 2010 Share Posted December 5, 2010 Its as easy to test as it is to answer. Get into the habit of testing your code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
trancexx Posted December 5, 2010 Share Posted December 5, 2010 Who's John? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
simpleraison Posted December 5, 2010 Author Share Posted December 5, 2010 Its as easy to test as it is to answer.Get into the habit of testing your code.Yeah i know i know its just the process take about 10 minutes to get to that perticular part of the process hence the reason i asked! I'll run it and see what happens! thanks alot anyway as i know that has sent me on the right path! Link to comment Share on other sites More sharing options...
simpleraison Posted December 5, 2010 Author Share Posted December 5, 2010 Who's John?Its JohnOne posted trancexx! Link to comment Share on other sites More sharing options...
simpleraison Posted December 5, 2010 Author Share Posted December 5, 2010 Its as easy to test as it is to answer.Get into the habit of testing your code.Oh and i just changed it back to WinExists as its probably better then WinWaitActive as that will be waiting for the window to become active and thats not always the case! I hope im right! Link to comment Share on other sites More sharing options...
JohnOne Posted December 5, 2010 Share Posted December 5, 2010 (edited) Just make a little script to run alongside and use as your test window, its no big headache. sleep(8000) guicreate("GUI") guisetstate() while 1 Sleep(10) wend put and exit function in it. Or simply use a notepad window or something. Edited December 5, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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