Hello Me You Posted February 10, 2007 Share Posted February 10, 2007 (edited) For example I want to make a script that opens notepad. Then do some actions (e.g. type some text) and wait (sleep) for the window (notepad) to close. If the window (notepad) close then the script exit. Edited February 10, 2007 by Hello Me You Random Link to comment Share on other sites More sharing options...
Developers Jos Posted February 10, 2007 Developers Share Posted February 10, 2007 For example I want to make a script that opens notepad. Then do some actions (e.g. type some text) and wait (sleep) for the window (notepad) to close. If the window (notepad) close then the script exit.... What have you tried ?Look at :Run()Sleep()WinWaitClose() Exit SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Hello Me You Posted February 10, 2007 Author Share Posted February 10, 2007 (edited) ... What have you tried ?Look at :Run()Sleep()WinWaitClose() ExitI will try to help you more: _______________________________________________________________________________________| say that the script is running| (notepad is open)| the script sends/types some text| maybe accidentally i close notepad before the script exit| after notepad close the script will continue sending keys| i want the script to automatically stop/exit so it wont send keys anymore to another window ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Edited February 10, 2007 by Hello Me You Random Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 10, 2007 Share Posted February 10, 2007 (edited) Hi, then you need to check everytime you are going to send something If WinExists Or use ControlSend So long, Mega Edited February 10, 2007 by th.meger Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Hello Me You Posted February 10, 2007 Author Share Posted February 10, 2007 (edited) Hi, then you need to check everytime you are going to send something If WinExists Or use ControlSend So long, Mega 1)why do u say all the time so long, mega? ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2)i am gonna try if win exists, can u help me use it? should i do this?: If winexits then send("text") else exit Edited February 10, 2007 by Hello Me You Random Link to comment Share on other sites More sharing options...
BALA Posted February 10, 2007 Share Posted February 10, 2007 (edited) something like this: While 1 ; do something here If NOT WinExists("Untitled -") Then ; Checks if "Untitled-" doesn't exist anymore (you can change this to any title) Exit ; Closes script EndIf WEnd Edited February 10, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Developers Jos Posted February 10, 2007 Developers Share Posted February 10, 2007 I will try to help you more: _______________________________________________________________________________________| say that the script is running| (notepad is open)| the script sends/types some text| maybe accidentally i close notepad before the script exit| after notepad close the script will continue sending keys| i want the script to automatically stop/exit so it wont send keys anymore to another window ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯You are going to help me more ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BALA Posted February 10, 2007 Share Posted February 10, 2007 For pausing a script, here's a function I got from the help file: Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Somerset Posted February 10, 2007 Share Posted February 10, 2007 You are going to help me more ? Yeah, because you don't speak the language of stupidity to well. They are helping you ,because you cannot get your head around the fact that they don't know how to read the help file.... explain it once explain it twice and they still, question because of lazy attitude... have a good day. Link to comment Share on other sites More sharing options...
Shevilie Posted February 10, 2007 Share Posted February 10, 2007 Well I would use ControlSend, since if the windows doesnt exist, it cant be send... Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit 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