tig8drag Posted August 29, 2008 Share Posted August 29, 2008 hi ... i'm executing script from another with ShellExecute ("AutoIt3.exe","test2.au3") that's work fine, but in same case it take mach time, so i want to stop the execution of the lunched script (test2) after a predefined timeout. and killing the Autoit process will end my principal script, and i dont want that happen ... can anyone give me some ideas please.. tester under construction ... please wait Link to comment Share on other sites More sharing options...
tig8drag Posted August 29, 2008 Author Share Posted August 29, 2008 oh it seams that i found a solution in test2 i should make a thing like this HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc and when i want to stop my script i samply use the hotkey ShellExecute ("AutoIt3.exe","test2.au3") Sleep(5000) Send("{ESC}") ; the rest of script there's other option ?? tester under construction ... please wait Link to comment Share on other sites More sharing options...
bogQ Posted August 29, 2008 Share Posted August 29, 2008 (edited) oh it seams that i found a solution in test2 i should make a thing like this HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc and when i want to stop my script i samply use the hotkey ShellExecute ("AutoIt3.exe","test2.au3") Sleep(5000) Send("{ESC}") ; the rest of script there's other option ?? WinClose() probably or WinKill() Edited August 29, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 29, 2008 Share Posted August 29, 2008 hi ... i'm executing script from another with ShellExecute ("AutoIt3.exe","test2.au3") that's work fine, but in same case it take mach time, so i want to stop the execution of the lunched script (test2) after a predefined timeout. and killing the Autoit process will end my principal script, and i dont want that happen ... can anyone give me some ideas please.. Run it with Run() instead of ShellExecute() so you get the PID back. If required, you can ProcessClose() it. If the script has a GUI that will recognize $GUI_EVENT_CLOSE and close itself, then you could just WinClose() it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
tig8drag Posted September 2, 2008 Author Share Posted September 2, 2008 Run it with Run() instead of ShellExecute() so you get the PID back. If required, you can ProcessClose() it. If the script has a GUI that will recognize $GUI_EVENT_CLOSE and close itself, then you could just WinClose() it. tks, i traied it and that work well, but i'm confused i traied to work with Run command before but it doesent working, but now that seams good tester under construction ... please wait Link to comment Share on other sites More sharing options...
herewasplato Posted September 2, 2008 Share Posted September 2, 2008 I know that you have it working like you want - but to document a few other options in this thread for when others find it in a forum search:Each autoit script has a hidden window and you can use AutoItWinSetTitle to change the title of that window then WinClose to end the second script.AutoItWinSetTitle("This is test2.au3") from the help file:RemarksThe AutoIt window is usually hidden. The purpose of changing the title is to allow other programs (or other AutoIt scripts) to interact with AutoIt.Also, /AutoIt3ExecuteScript can be used to start another script from a main script. See this thread for examples of how to do it if the main script is an au3 file. http://www.autoitscript.com/forum/index.php?showtopic=22531So many options :-) [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