Hey all,
I have modified Hutch's script to fulfill my requirements and make it more complete i guess, as such i think everyone can safely add this script to their includes directory and use it easily now!
So this is the long awaited summary I've been waiting for, hehe
Quote:
Features :
- display hotstrings (and expansion if no ;; comment), allows :*: hotstrings and other variations (i.e.

: ...etc)
- display Hotkey (only if comment ;;)
- ignore single comment lines
- include all other features from before (i.e. display hotstrings, hotkeys, ;; comments ...etc)
- standalone script can be included in file - see below
e.g. #include KeyList.AHK
#z:: ;;Show this list
KeyList(A_ScriptFullPath)
KeyWait, z
Progress, off
return
Save as KeyList.ahkCode:
; http://www.autohotkey.com/forum/topic215.html
;*******************************************************************************
; Extract a list of Hotstrings and Hotkeys from this script and display them
;*******************************************************************************
; Modified by Vixay Xavier on Sat October 11, 2008 06:02:29 PM
;#SingleInstance force
KeyList(scriptfile)
{
AutoTrim,off
Loop,Read,%scriptfile%
{
Line=%A_LoopReadLine%
; Only show lines that contain double semicolons
IfInString,Line,`;`;
{
StringLeft,First2Chars,Line,2
StringLeft,FirstChar,Line,1
; Insert blank or comment lines (start with double semicolon)
IfEqual,First2Chars,`;`;
{
StringTrimLeft,Desc,Line,2
KeyList=%KeyList%%Desc%`n
Continue
}
; Insert Hotkeys and Hotstrings (must contain double colon)
IfInString,Line,`:`:
{
; Extract description (after last semicolon)
StringSplit,Desc,Line,`;`:
StringTrimLeft,Desc,Desc%Desc0%,0
; If description is blank, use command or hotstring text instead
If Desc=
{
EnvSub,Desc0,2
StringTrimLeft,Desc,Desc%Desc0%,0
}
; Extract keys
StringSplit,Keys,Line,`:
; Hotstrings (start with double colon)
IfEqual,First2Chars,`:`:
{
Keys=%Keys3%
IfEqual,Desc,,SetEnv,Desc,%Keys5%
}
; Hotstrings (start with single colon) - i.e. those hotstrings with options given. e.g. :c:tt::ta ta
Else IfEqual,FirstChar,`:
{
Keys=%Keys3%
IfEqual,Desc,,SetEnv,Desc,%Keys5%
;MsgBox, 1st char = %FirstChar% 2 chars = %First2Chars% split = %Keys% line = %line% ;DEBUG
}
; Hotkeys (start with anything else)
Else
{
StringReplace,Keys,Keys1,#,Win- ;Why the Keys1 here instead of Keys?
StringReplace,Keys,Keys,!,Alt-
StringReplace,Keys,Keys,^,Ctrl-
StringReplace,Keys,Keys,+,Shift-
StringReplace,Keys,Keys,`;,
}
; Add to the list
; Make keys 15 long with trailing spaces to keep the list neatly formatted
Keys=%Keys% !
StringLeft,Keys,Keys,15
Desc=%Keys% %Desc%
KeyList=%KeyList%%Desc%`n
; Keep track of longest line to set window width later
StringLen,Len,Desc
If Len > %MaxLen%
MaxLen = %Len%
}
}
}
; Now show the list
EnvMult,MaxLen,8.0 ; pixel width of 1 character
EnvAdd,MaxLen,20 ; + 2 x 10 pixel margins
StringTrimRight,KeyList,KeyList,1
; Sort, KeyList, P16 ; sort the comments
Progress, M2 C00 ZH0 FS10 W%MaxLen%,%KeyList%,,Hotkeys and Hotstrings list,courier new
KeyList=
MaxLen=
Return
}
;a function to take care of replacing symbols in shortcut keys with their words
HumanReadableShortcut(key)
{
StringReplace,Key,Key,+,Shift%A_Space%+%A_Space%
StringReplace,Key,Key,#,Win%A_Space%+%A_Space%
StringReplace,Key,Key,!,Alt%A_Space%+%A_Space%
StringReplace,Key,Key,^,Ctrl%A_Space%+%A_Space%
;StringReplace,Key,Key,),String%A_Space%is%A_Space%
Return %Key%
}
; FOR TESTING AS STANDALONE SCRIPT, if it is included in another script it will be safely ignored
; ;****************************************************
; ;Add Hotkeys and Hotstrings Below
; ;****************************************************
; ;; HotKeys
; ^z:: ;;Show This List - use the following code in your function call for script
KeyList(A_ScriptFullPath)
Sleep 1000
KeyWait, z
Progress, off
ExitApp
;add comments like these to your own script to make the
; output of this script easier to read
;;===Global Hotstrings===
::t1::tester! ;;
:c:t2::testmy! ;;
; ;****************************************************
; ;Add the List to the AHK Menu
; ;****************************************************
; Menu,Tray,Add,Hot&keys list,KeyList
; Menu,Tray,Default,Hot&keys list
; ;Run once
; KeyList(%A_ScriptFullPath%)
; KeyWait, z
; Progress, off
also hutch, it won't show when compiled, because when an exe, it can't read the source and show the summary! so you have to point it to the source file!!! that is if you want to use the feature in the executable

i.e.
myscript.exe
myscript.ahk - must be in same dir as executable
or you could hardcode it in
code in myscript.ahk should be
Quote:
#z:: ;;Show this list
If A_IsCompiled
{
StringTrimRight, script, A_ScriptFullPath, 3
script = %script%ahk
}
Else
{
script = %A_ScriptFullPath%
}
KeyList(script)
Sleep 1000
KeyWait, z
Progress, off