BryanMc Posted May 1, 2010 Posted May 1, 2010 (edited) well i was wondering if anyone knows how to make a function that will close the script then reopen it... refresh u can say but in a function way.... for example: I'll have a hot key for a function... lets say the hot key is f1, when i hit f1 the script that I'm using will close then reopen itself... if that's not possible then is there a way we can make it like refresh the script? as in turn EVERY thing off that its doing (talking about the script) any help would be great.... thanks... just need the faction part... i can set a hotkey my self Edited May 1, 2010 by BryanMc
somdcomputerguy Posted May 1, 2010 Posted May 1, 2010 Try this, Re-Start your Program. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
BryanMc Posted May 1, 2010 Author Posted May 1, 2010 (edited) Try this, Re-Start your Program. i'm still new to scripting but can u explain this code to me?Code below:Func _restart() If @Compiled = 1 Then Run( FileGetShortName(@ScriptFullPath)) Else Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf ExitEndFuncI have highlishted some text to red to show my point.... do i replace that in red with my script name? lets say my script is test.au3 --- how would i go about putting that into make it restart my script? Edited May 1, 2010 by BryanMc
somdcomputerguy Posted May 1, 2010 Posted May 1, 2010 (edited) The simplicity of this snippet had me confused for awhile too. Basically, it just starts another copy of the calling script, and exits the first copy.Nothing needs to be replaced. FileGetShortName is an AutoIt function. See Macro Reference for definitions of the three macros used. Edited May 1, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
BryanMc Posted May 1, 2010 Author Posted May 1, 2010 The simplicity of this snippet had me confused for awhile too. Basically, it just starts another copy of the calling script, and exits the first copy.Nothing needs to be replaced. FileGetShortName is an AutoIt function. See Macro Reference for definitions of the three macros used.omg thanks so much this is exatly what i was trying to do thanks
somdcomputerguy Posted May 1, 2010 Posted May 1, 2010 You bet. You know, the thread where I got that snippet from has a bunch of other useful code snippets. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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