I usually have quite a few uncompiled (.ahk format) scripts running and these need to be closed before I can update to a new version of AutoHotkey (since uncompiled scripts make use of AutoHotkey.exe). I've updated it to also be able to just close selected processes.
This script shows a list of all such running scripts and has a button for stopping them and a button for restarting them (after having updated AutoHotkey).
Save the script from the link below, but note that is MUST be compiled before use otherwise AutoHotkey.exe will still be in use, since the script can't stop itself :wink:
AutoHotkey Script Restarter
Updated to v1.01:
- Selected script processes can be ended (e.g. tidy up after testing some scripts out).
- Option to also close the help file (for updating).
- Some small fixes.
Thanks go to Shimanov for his code to retrieve the process information and the command line parameters they were run with.
AutoHotkey Script Restarter v1.01
Started by
evl
, Apr 02 2006 02:06 AM
27 replies to this topic
#1
-
Posted 02 April 2006 - 02:06 AM
- A repeating line, is this a typo ?
GuiClose: GuiEscape: HandleExit: DllCall( "CloseHandle", "uint", ht_this ) DllCall( "CloseHandle", "uint", hp_this ) ExitApp- Perhaps one should/could add AutoHotkey.chm to the list of running processes
#2
-
Posted 02 April 2006 - 04:57 AM
That's part of Shimanov's code and I don't think it's a typo.
I thought about also closing the manual but wasn't sure. I'll probably add a checkbox for whether to close it or not, thanks for reminding me about that.
I thought about also closing the manual but wasn't sure. I'll probably add a checkbox for whether to close it or not, thanks for reminding me about that.
#3
-
Posted 02 April 2006 - 12:31 PM
Updated to v1.01 (see 1st post):
- Selected script processes can be ended (e.g. tidy up after testing some scripts out).
- Option to also close the help file (for updating).
- Some small fixes.
- Selected script processes can be ended (e.g. tidy up after testing some scripts out).
- Option to also close the help file (for updating).
- Some small fixes.
#4
-
Posted 02 April 2006 - 01:21 PM
I upgraded succcessfully to AutoHotKey 1.0.43.03 commenting one of the above double lines.
#6
-
Posted 03 April 2006 - 05:14 PM
I just updated too. Those lines are not doubled as far as I'm aware - they're for closing handles that the script creates during its running. Although it will function without both of them, it would leave behind un-closed handles to processes after the script exits. That's my understanding, but it's shimanov's bit of script.
#7
-
Posted 03 April 2006 - 05:32 PM
evl is right.
Besides, the lines are not identical: "ht_this" vs "hp_this"
Besides, the lines are not identical: "ht_this" vs "hp_this"
#9
-
Posted 04 April 2006 - 07:00 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
I picked a good time to write this script - 2 AutoHotkey updates from Chris in as many days :lol: Maybe Chris could integrate something like this into the installer itself? I'm not sure if there would be a convenient way of doing it though because I have no experience of packaging software with an installer.
#11
-
Posted 04 April 2006 - 04:46 PM
Some kind of auto-update or update-check is already on the to-do list due to repeated suggestions from others over the past two years. Thanks.
#12
-
Posted 05 April 2006 - 10:37 AM
very useful script, but i had run into a problem because i use the zipped version of AHK.
I had this confirmed by checking the help file. It has to do with the built-in variable, A_AhkPath which, in a compiled script, looks for AutoHotkey.exe here -> HKLM\SOFTWARE\AutoHotkey\InstallDir. Since there will be no such key in the registry, A_AhkPath will be blank and therefore the script would raise an error.
So this is my work-around, in case anyone else has had same the problem... :wink:
badmojo
I had this confirmed by checking the help file. It has to do with the built-in variable, A_AhkPath which, in a compiled script, looks for AutoHotkey.exe here -> HKLM\SOFTWARE\AutoHotkey\InstallDir. Since there will be no such key in the registry, A_AhkPath will be blank and therefore the script would raise an error.
So this is my work-around, in case anyone else has had same the problem... :wink:
; If compiled, put AHK.exe path into this variable, AHKPath ; because the internal var A_AhkPath would be empty AHKPath=%ProgramFiles%\AutoHotkey\AutoHotkey.exe ... ;Run, %A_LoopField%, %Script_WorkingDir% Run, %AHKPath% %A_LoopField%
badmojo
#13
-
Posted 06 April 2006 - 03:11 AM
I didn't use A_AhkPath anywhere in the script. The script retrieves the path to the .ahk file and just runs that, with the same directory as its working directory (very important or else you get your ini files not saved in the right place etc). Nowhere does it include the path to autohotkey.exe.
I can only think that you don't have ahk files associated to run when double-clicked?
I can only think that you don't have ahk files associated to run when double-clicked?
#14
-
Posted 06 April 2006 - 10:47 AM
you're right, i don't have ahk files associated with AHK. that's why i had to modify this line:I can only think that you don't have ahk files associated to run when double-clicked?
;Run, %A_LoopField%, %Script_WorkingDir% Run, %A_AHKPath% %A_LoopField%but of course, in my case A_AhkPath is blank, therefore i had to add a variable containing the path to AHK's exe. sorry for not clarifying but i thought that by mentioning that i was using the zipped version of AHK, one would assume this would be the case...
anyway, tks for the super-cool script. :idea:
#15
-
Posted 10 April 2006 - 01:24 AM