Better display of current scripts in task mgr

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
DyNama
Posts: 14
Joined: 26 Jul 2014, 14:00
Location: Ohio, USA
Contact:

Better display of current scripts in task mgr

22 Feb 2016, 23:02

I have several AHK scripts in my win 7 x64 startup, but they all show the same in task manager:

Image Name_____User Memory Description
AutoHotkey.exe Dy 00 260 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 420 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 252 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 108 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 108 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 384 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 236 K AutoHotkey Unicode 64-bit
AutoHotkey.exe Dy 00 284 K AutoHotkey Unicode 64-bit


All the files are .ahk files, like hotstrings.ahk or AutoCorrect For AHK-L.ahk. Some times I want/need to end task just 1 of my running scripts but i cant tell them apart. is there any way to set either the "Image Name" or "Description" when the file loads? I am a novice AHK programmer but I couldn't find anything in AHK Help.
User avatar
jmeneses
Posts: 524
Joined: 28 Oct 2014, 11:09
Location: Catalan Republic

Re: Better display of current scripts in task mgr

23 Feb 2016, 03:42

Hi Dynama,

Does not appears icons of your scripts?
When mouse over in tray icon you know the name of the script and can exit script
also you can get executables with different names and then see in TaskMgr

See "Convert a Script to an EXE (ahk2exe)"
https://autohotkey.com/docs/Scripts.htm#ahk2exe

Samples
Ahk2Exe.exe /in MyScript.ahk [/out MyScript.exe] [/icon MyIcon.ico] [/bin AutoHotkeySC.bin] [/mpress 0or1]
Ahk2Exe.exe /in "MyScript.ahk" /icon "MyIcon.ico"
Donec Perficiam
SifJar
Posts: 398
Joined: 11 Jan 2016, 17:52

Re: Better display of current scripts in task mgr

23 Feb 2016, 06:57

jmeneses wrote:Hi Dynama,

Does not appears icons of your scripts?
When mouse over in tray icon you know the name of the script and can exit script
also you can get executables with different names and then see in TaskMgr

See "Convert a Script to an EXE (ahk2exe)"
https://autohotkey.com/docs/Scripts.htm#ahk2exe

Samples
Ahk2Exe.exe /in MyScript.ahk [/out MyScript.exe] [/icon MyIcon.ico] [/bin AutoHotkeySC.bin] [/mpress 0or1]
Ahk2Exe.exe /in "MyScript.ahk" /icon "MyIcon.ico"
Converting to EXE will mean that each script would be running with it's own instance of AHK, rather than essentially "sharing" one instance of AHK as happens when running multiple scripts. i.e. uses more resources for same effect.

The tray icons are probably a better idea, however scripts can define #NoTrayIcon to hide their icons, and some people prefer to have as few icons as possible cluttering their tray. However, in this case it's probably best to have the icons showing for any scripts you're likely to close etc.

AFAIK, there's no way to get different names to appear in Task Manager for uncompiled scripts, though.
CodeKiller
Posts: 42
Joined: 02 Sep 2014, 04:14

Re: Better display of current scripts in task mgr

23 Feb 2016, 07:28

In fact there is a way, you can create copy of ahk.exe and rename it to the name of the script and run the script from a "global" script.
Global script :
xcopy ahk.exe myscript.exe
myscript.exe myscript.ahk

So in taskmanager you will have myscript.exe.

Each time to exist the script you can delete the temporary exe. ;-)
User avatar
DyNama
Posts: 14
Joined: 26 Jul 2014, 14:00
Location: Ohio, USA
Contact:

Re: Better display of current scripts in task mgr

23 Feb 2016, 15:05

Thanx, gang! I do in fact suppress a few of the tray icons with #NoTrayIcon for scripts i'm unlikely to interact with, like AutoCorrect.ahk.

I've always wondered if running additional scripts shares resources or if each one is a separate instance which would seem extravagant, as SifJar says.

as to CodeKiller's suggestion of cloning ahk.exe, that's a definite possibility I should have thought of. I cloned my picture viewer VuePrint precisely for that reason, so it would show up as VuePrint-1, VuePrint-2, &c., in Task Manager. And as per jmeneses' comment, I forgot I do have some compiled ahk scripts always running, like CloseToQuit.exe, that show up unambiguously in Task Manager.

Thanx for the help!
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Better display of current scripts in task mgr

23 Feb 2016, 22:34

There are scripts for managing other running scripts, such as my AHKControl, which offers a lot more control than task manager.

If you use task manager to terminate a script, any OnExit label or callbacks set by the script probably won't run, and it may leave a "zombie" tray icon (which disappears when you point the mouse at it).

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Theda and 262 guests