00pontiac Posted June 23, 2011 Share Posted June 23, 2011 I'm not exactly new to scripting or AutoIt, but I do seem to struggle my way through things every time... This script works beautifully to close my window : While 1 Sleep(100) If WinExists("Window Name") Then WinClose("Window Name") WEnd My problem is simply Exiting the script once the window closes. I know, I'm pretty stupid, eh? Yes, I've looked at the docs and searched and read results for almost two hours determined to figure this out... and I'm embarrassed to be posting this Thanks for reading my verbose plea for help Link to comment Share on other sites More sharing options...
enaiman Posted June 23, 2011 Share Posted June 23, 2011 Ever heard about "Exit"? SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
00pontiac Posted June 23, 2011 Author Share Posted June 23, 2011 (edited) er... of course I have. too bad you offered no examples... instead I have your denigration... ty Edited June 23, 2011 by 00pontiac Link to comment Share on other sites More sharing options...
smartee Posted June 23, 2011 Share Posted June 23, 2011 An example of Exit? Here you go If WinExists("Window Name") Then WinClose("Window Name") Exit EndIf Link to comment Share on other sites More sharing options...
smartee Posted June 23, 2011 Share Posted June 23, 2011 (edited) hi 00pontiac, Welcome to the forums I don't think enaiman was trying to attack you personally, there are a wealth of examples of using Exit in the helpfile if you felt you needed one. So cool down a bit, he was helping you, don't spurn hate when you get a tidbit of advice. Back to the topic, If the script in your OP is your entire script(or the basic structure of it), you might want to take a look at WinWait() in the helpfile Regards, -smartee EDIT: Added welcome, advice, tip, fixed spacing. Edited June 23, 2011 by smartee Link to comment Share on other sites More sharing options...
00pontiac Posted June 23, 2011 Author Share Posted June 23, 2011 Thank you Smartee sometimes all I need is a simple suggestion to divert me from the wall I'm banging my head against. I'm no pro at autoit, that's for sure, but I have a dozen scripts or more that I've done in the past and never got stuck as badly as I did tonite... is all the syntax sometimes, I just couldn't get past it. WinWait... duh... I think I knew that. let's see, I installed autoit for the first time (according to date created) in aug. 2008... like I said, embarrassed to have posted this. (and thanks for the welcome btw) Link to comment Share on other sites More sharing options...
JohnOne Posted June 23, 2011 Share Posted June 23, 2011 Also, you can Use ExitLoop, which will just exit that particular while loop and continue with any other script you may have after it. 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...
enaiman Posted June 23, 2011 Share Posted June 23, 2011 Flaming is very easy and a thread can get out of control very quick. I don't want to do either so I will say only this: - I was giving you all the help you needed. "Exit" is such an obvious command that anybody would think to search for. By asking how do you exit a script, you have proven to ME that you even didn't bother looking and you went straight for the laziest solution - ask for help in the forum. A simple 1 minute look in the help file (or Online help) would have given you the answer. By asking for an "example of using "Exit"" you have proven again my above point; if you had simply put an Exit somewhere in your 3 code line script - after all you can only have the Exit in 5 places in your script: - before first line: - no sense in that - after "While 1", your script would exit without doing anything - after "Sleep(100)", same as above - after "If WinExists("Window Name") Then WinClose("Window Name")" ... guess you had your answer here - no need to consider the last one. The conclusion should be obvious too. That's all I had to say. I won't reply again in this thread, if you post anything, it is likely that I will read your post and that's all. I will stay away of any of your threads in the future. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) 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