Jump to content

Recommended Posts

Posted (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 by BryanMc
Posted (edited)

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

Exit

EndFunc

I 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 by BryanMc
Posted (edited)

The simplicity of this snippet had me confused for awhile too. :idea: 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 by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Posted

The simplicity of this snippet had me confused for awhile too. :idea: 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...