This script creates a Hotkey Help dialog that shows all the Hotkeys found in all of the AHK files currently running.
It finds the names of all the running AHK programs through looking at Hidden Windows. This is done by a function that others might find useful. I have commentted this function at the end.
It then scans those AHK files for hotkeys and hotstrings.
It also scans those files for #Include and then recursively scans those files also.
It can detect compiled AHK EXE files but it can not scan them for hotkeys and those EXE would not contain any help comments so instead it looks for an AHK file with the same name as the EXE in the same location, working directory, or script directory; and scans it if found.
In a similar fashion Help will also look for a text file with the same names as the AHK script and get hotkey information and comments from that file if it exist.
You can change the settings within the running script and save your settings to an INI file.
There are various settings that can be adjusted and saved to the INI file.
You can also edit the script at the top to add specific files, hotkeys, and hotstrings to ignore.
When the Help dialog is the active window, control+f will bring up a "Find" command.
The Find dialog attempts to find open space to dock in this order: bottom under outside, bottom right outside, bottom left outside, and then inside the window in the bottom right. But the Find dialog can also be dragged to a location. This location is remembered in relation to the top left corner of the Help dialog. If you double click the status bar of the Find dialog it will reset location and redock. The settings also has an option to save the Find dialog location in the settings INI file and remember between sessions. As well as a button to reset the location if for some reason you undocked it then moved the parent window to cause the Find dialog to be lost off screen.
Link to DOWNLOAD CODE:
SAMPLE DIALOG
Code: Select all
SAMPLE DIALOG
============================= HOTKEY HELP ============================
Win+f1 <--- Show Hotkey Help
Win+Alt+f1 <--- Change Hotkey Help Settings
Win+Ctrl+f1 <--- Display Files, Hotkeys, and Hotstrings Excluded
============================ GOOGLE SEARCH ===========================
Win+g <-- Google Search Highlighted Selection
Win+Ctrl+Alt+Escape
============================= DICTIONARY =============================
Win+Alt+d <-- Open Dictionary Input Box
Win+Ctrl+d <-- Dictionary Search Highlighted Selection
Win+Ctrl+Alt+Escape
========================== HOTSTRING HELPER ==========================
Win+h <-- Create Hotstring for Selected Text
Win+Ctrl+Alt+Escape
HotString: tdate <-- Today's Date
HotString: pfa = please find attached
======================== STARTUP - AUTOHOTKEY ========================
Win+Ctrl+Alt+Escape
============================= SECURE PDF =============================
Win+Ctrl+s <-- Secure PDF
Win+Alt+s <-- Unsecure PDF
======================== EMAIL ATTACHMENT LIST =======================
Win+a <-- Add email attachment list as single line
Win+Ctrl+a <-- Add email attachment list table
Win+Alt+a <-- Add email attachment list table with file numbers
++++++++++++++++++++++++++++ IMAGE CAPTURE +++++++++++++++++++++++++++
PrintScreen capture drawn rectangle
ScrollLock capture active window
Pause capture active monitor
Ctrl+Escape
+?+?+?+?+?+?+?+?+?+?+?+?+?+?+? MTGO FREE +?+?+?+?+?+?+?+?+?+?+?+?+?+?+
+-+-+-+-+-+-+-+-+-+-+-+-+-+- CLICK - TRADER +-+-+-+-+-+-+-+-+-+-+-+-+-
------------------------------ TILLAGOTO -----------------------------
------------------------------- TOOLBAR ------------------------------
---------------------------- PLATFORMREAD ----------------------------
---------------------------- COMINTERFACE ----------------------------
---------------------------- SCITEDIRECTOR ---------------------------
----------------------------- SCITEMACROS ----------------------------
---------------------------- PROFILEUPDATE ---------------------------
I do.
#a:: ; <--- This is a Sample Hotkey
The spacing between the :: and ; is not important as the script parses for the imformation and then spaces it uniformily.
Because it is using RegEx to attempt to identify Hotkeys it can probably be fooled. It attempts to weed out things that look like hotkeys but are not like text in comments or the use of :: in weird places.
Through information about values stored in variables that running scripts can be forced to report the Help attempts to evaluate the key definitions of hotkeys created with keys defined by variables. It is not always correct though because Help can only determine the current value of a variable which may not necessarily be the same as it was when a hotkey was created using that variable.
A raw view of hotkey combinations being used by all running scripts can be seen also. This information is retrieved from the running scripts directly so contains no comments but should pickup most all current hotkeys.
Also the main help dialog contains buttons for Stopping, Pausing, Suspending, Editing, Reloading and Opening scripts.
A text file can also be created with the same name as an AHK script that can contain help information without having to edit the actual AHK script. Txt is the default extension but custom extensions can be defined in the variable initialization of Hotkey Help. Sometimes when dealing with other peoples scripts it is easier to just put the help comments in a txt file especially if they update the script a lot causing it having to be re-commented each time it is updated.
These text help files need to contain a hotkey definition line with :: and ; similar to an actual hotkey definition line in a script. ie.
^#a:: ; <-- ~ Word ~ Save All Files
^#a:: ; <-- ~ Adobe ~ Authorization Stamp
^#b:: ; <-- Backup
FG