Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post your working scripts, libraries and tools for AHK v1.1 and older
Guest

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

26 Oct 2016, 04:10

This a great utility. I only wonder, how to reduce the displayed shortcuts to the relevant context. E.g. if I got "Chrome" active, only display the hotkeys relevant to "Chrome" and globally.

[ Moved from Scripts and Functions: TLM ]
Guest

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

26 Oct 2016, 04:19

Sorry for the double post. Did not see your reply. Also can't register due to registration confirmation mail not getting sent.

Anyways, thanks for the explanation. Your work-arround sounds feasible. Can you point me to the functions that I would need to change accordingly?
nicrox
Posts: 14
Joined: 14 Mar 2016, 19:05

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

24 Aug 2017, 20:05

Thanks for this script, motivated me a lot to expand my HS list.
I can see on the Sample Dialog a reference to "create hotstring" by pressing Win+h on a selected text. It doesn't seem to do anything on mine, any other script I need to download to active that. It would be really helpful if such a function is available

Edit: for those interested, i found the solution: https://autohotkey.com/docs/Hotstrings.htm#Helper
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

21 Dec 2017, 23:20

Hi FanaticGuru, I have a question if you don't mind. I have used this script a lot and I love it. My problem is I am getting the can't create control situation happening. I have a feeling it's because of all the many hotkeys and scripts i have running that I want a combined list from (so I'd rather not close them and do it piecemeal. I am wondering if it's possible to have an option to simply save the result in a txt file as opposed to the msgbox that it usually displays in. I always just copy the whole thing and save to a file anyway. It quickly helps me determine if I have relative duplicates. Thanks in advance.
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

21 Dec 2017, 23:23

Nicrox do you mean this? I changed the hotkey but the result is the same that I think you are referring to.

Code: Select all

#d::    ;;Add new hotstring/hotkey 
; Get the text currently selected. The clipboard is used instead of
; "ControlGet Selected" because it works in a greater variety of editors
; (namely word processors).  Save the current clipboard contents to be
; restored later. Although this handles only plain text, it seems better
; than nothing:
AutoTrim Off  ; Retain any leading and trailing whitespace on the clipboard.
ClipboardOld = %ClipboardAll%
Clipboard =  ; Must start off blank for detection to work.
Send ^c
ClipWait 1
if ErrorLevel  ; ClipWait timed out.
	return
; Replace CRLF and/or LF with `n for use in a "send-raw" hotstring:
; The same is done for any other characters that might otherwise
; be a problem in raw mode:
StringReplace, Hotstring, Clipboard, ``, ````, All  ; Do this replacement first to avoid interfering with the others below.
StringReplace, Hotstring, Hotstring, `r`n, ``r, All  ; Using `r works better than `n in MS Word, etc.
StringReplace, Hotstring, Hotstring, `n, ``r, All
StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All
StringReplace, Hotstring, Hotstring, `;, ```;, All
Clipboard = %ClipboardOld%  ; Restore previous contents of clipboard.
; This will move the InputBox's caret to a more friendly position:
SetTimer, MoveCaret, 10
; Show the InputBox, providing the default hotstring:
InputBox, Hotstring, New Hotstring, Medscribe Work script. Provide the corrected word on the right side. You can also edit the left side if you wish.`n`nExample entry:`n::teh::the,,,,,,,, :*:%Hotstring%::%Hotstring%
if ErrorLevel <> 0  ; The uer pressed Cancel.
	return
; Otherwise, add the hotstring and reload the script:
FileAppend, `n`n%Hotstring%, %A_ScriptFullPath%  ; Put a `n at the beginning in case file lacks a blank line at its end.
Reload
Sleep 200 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
MsgBox, 4,, The hotstring just added appears to be improperly formatted.  Would you like to open the script for editing? Note that the bad hotstring is at the bottom of the script.
IfMsgBox, Yes, Edit
return
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

22 Dec 2017, 01:47

Kellyzkorner_NJ wrote:Hi FanaticGuru, I have a question if you don't mind. I have used this script a lot and I love it. My problem is I am getting the can't create control situation happening. I have a feeling it's because of all the many hotkeys and scripts i have running that I want a combined list from (so I'd rather not close them and do it piecemeal. I am wondering if it's possible to have an option to simply save the result in a txt file as opposed to the msgbox that it usually displays in. I always just copy the whole thing and save to a file anyway. It quickly helps me determine if I have relative duplicates. Thanks in advance.
What error are you getting for "can't create control situation happening"?

Are you using AHK 32 bit or 64 bit?

How big would the help dialog be that is failing? Over 32k, several 100k, megs? If the Gui control is getting more info than it can hold there are ways to work around the limit. Basically you cannot let the control autosize and have to explicitly tell it how big to be which requires some calculating that the control does not currently do.

I could have a way to save the help dialog to a text file. Right before it creates the Gui all the information is stored in a variable called Display. It would be easy to save to a file. Mainly just the logistics of how to activate. Another hotkey combination is clumbersome. Maybe a button on the Settings dialog to export to a text file. Or even just a checkbox to always save a text file when the help dialog is updated. But for that option I would need to have the dialog display correctly even if large.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

27 Dec 2017, 21:32

Hello, I believe I'm using the 64. The control would be huge, I am trying to get a listing of what amounts to probably 15 scripts but the main one is at least 29000 lines long. It has a lot of keys in it. I think the problem is with the GUI needing to be bigger than it is "allowed" although I don't know the size exactly. That would be great regarding the text. I have gotten the script to work with closing some of the scripts so the Hotkey Help script itself isn't the problem. I'm sorry for the delay. What can I do to help you, try to create one that is large an dsend to you?

Thanks in advance, I appreciate your help.

Kelly
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

28 Dec 2017, 14:07

As a followup, so far as the can't create control, I run the script, what I assume is happening is it is running and gathering from the scripts running and when it hits the upper level of whatever is stopping it, the size, it pops up with the error can't create control, right before the time when normally the GUI window would come up. I hope that makes it clearer. I don't know how to tell how big the help dialog would be. For myself, saving it as text could be done invisibly and just have a file created and self named. It doesn't need to be a button on GUI or hotkey, for my purposes anyway.
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

28 Dec 2017, 21:34

Kellyzkorner_NJ wrote:As a followup, so far as the can't create control, I run the script, what I assume is happening is it is running and gathering from the scripts running and when it hits the upper level of whatever is stopping it, the size, it pops up with the error can't create control, right before the time when normally the GUI window would come up. I hope that makes it clearer. I don't know how to tell how big the help dialog would be. For myself, saving it as text could be done invisibly and just have a file created and self named. It doesn't need to be a button on GUI or hotkey, for my purposes anyway.
I posted an update on the first page that should give you what you need.

I added an option on the settings dialog that allows you to check a box to have a text file exported automatically when a new dialog is created. Also a button in the settings to force the export to a text file.

Also looked into the fail to create control. There is a 32k limit to text when a control is being created. So cannot create the control with large text amount in one command. It can be worked around by creating a control and then adding text to it in separate command. I believe I got that working but did not really have a readily available test for it.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

02 Jan 2018, 21:05

Thank you very much , I appreciate your working on this for me. I hope you have a very happy new year!
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

02 Jan 2018, 21:10

Worked perfectly, you are the BEST FanaticGuru!
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

06 Jan 2018, 22:27

Hello, Just a little followup, I am seeing that the list that generates has duplicates in it, which is okay, I just run a remove duplicates script on it and resave it, I just wanted you to know. Also after it's first run the great list of options at the top starting with stop script don't show, just the stop script does. Could be my machine, just throwing it out there. Again not a huge deal, they are still available if you mouse over them, they just aren't visually showing up but I can deal with it.

Kelly
Bredda

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

07 May 2018, 15:02

Chapeau, FantasticGuru!
Thank you for sharing this solution. Is there currently a way to search the GUI for a certain keyword?
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

08 Nov 2018, 18:14

this script fails when the script being examined is named "numpadmouse". Any close variation to that works fine.

It shows the script but does not display it's hotkeys.
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

08 Nov 2018, 19:26

joefiesta wrote:
08 Nov 2018, 18:14
this script fails when the script being examined is named "numpadmouse". Any close variation to that works fine.

It shows the script but does not display it's hotkeys.

I can't replicate this problem. It works fine for me.

Code: Select all

1::  ; <-- Hey Hey
	MsgBox test 
return
I save this script as numpadmouse.ahk and run it. I see the script, hotkey, and comment as expected.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

09 Nov 2018, 12:29

this script fails when the script being examined is named "numpadmouse". Any close variation to that works fine.

It shows the script but does not display it's hotkeys. I wish I could figure this out, but I was not able to.
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

09 Nov 2018, 15:44

Updated in First Post

Change Log: Version 2.94 (2018-10-22)
Added a "Find" command to find text within the Help dialog.
When the Help dialog is active, Control+f will bring up the Find box.

This is done through a class called SearchEdit which is written in a generic way that could be used with other scripts to add a find command to an edit control.

SearchEdit tries to position the find dialog in open space around the edit control. The find dialog can also be dragged with left mouse.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

09 Nov 2018, 18:33

Thanks for the update, FG. I believe this code is missing from the page at the link on page 1 of this topic. I added it back in and it works:

Code: Select all

AHKScripts(ByRef Array)
{
	DetectHiddenWindows, % (Setting_A_DetectHiddenWindows := A_DetectHiddenWindows) ? "On" :
	WinGet, AHK_Windows, List, ahk_class AutoHotkey
	Array := {}
	list := ""
	Loop %AHK_Windows%
	{
		hWnd := AHK_Windows%A_Index%
		WinGetTitle, Win_Name, ahk_id %hWnd%
		File_Path := RegExReplace(Win_Name, "^(.*) - AutoHotkey v[0-9\.]+$", "$1")
		SplitPath, File_Path, File_Name, File_Dir, File_Ext, File_Title
		Array[A_Index,"Path"] := File_Path
		Array[A_Index,"Name"] := File_Name
		Array[A_Index,"Dir"] := File_Dir
		Array[A_Index,"Ext"] := File_Ext
		Array[A_Index,"Title"] := File_Title
		Array[A_Index,"hWnd"] := hWnd
		list .= File_Path "`n"
		
	}
	DetectHiddenWindows, %Setting_A_DetectHiddenWindows%
	return Trim(list, " `n")
}
Regards,
burque505
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

09 Nov 2018, 18:59

burque505 wrote:
09 Nov 2018, 18:33
Thanks for the update, FG. I believe this code is missing from the page at the link on page 1 of this topic. I added it back in and it works:

Code: Select all

AHKScripts(ByRef Array)
{
	DetectHiddenWindows, % (Setting_A_DetectHiddenWindows := A_DetectHiddenWindows) ? "On" :
	WinGet, AHK_Windows, List, ahk_class AutoHotkey
	Array := {}
	list := ""
	Loop %AHK_Windows%
	{
		hWnd := AHK_Windows%A_Index%
		WinGetTitle, Win_Name, ahk_id %hWnd%
		File_Path := RegExReplace(Win_Name, "^(.*) - AutoHotkey v[0-9\.]+$", "$1")
		SplitPath, File_Path, File_Name, File_Dir, File_Ext, File_Title
		Array[A_Index,"Path"] := File_Path
		Array[A_Index,"Name"] := File_Name
		Array[A_Index,"Dir"] := File_Dir
		Array[A_Index,"Ext"] := File_Ext
		Array[A_Index,"Title"] := File_Title
		Array[A_Index,"hWnd"] := hWnd
		list .= File_Path "`n"
		
	}
	DetectHiddenWindows, %Setting_A_DetectHiddenWindows%
	return Trim(list, " `n")
}
Thanks for letting me know. When your function library grows large, it is easy to forget to include all dependancies when uploading.

Fixed the linked file in first page.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

10 Nov 2018, 17:36

Re: Numpadmouse.ahk hotkeys don't display

Oops... I dug further and found that I had run this script back in 2014. And, at the time I added an EXCLUDE for numpadmouse.ahk. in the .ini file. Sorry about the false alarm.

However, it does bring to light one important point. The display, when a file is excluded, still includes the file, which is fine. The problem is: it displays NO DIFFERENTLY than any other script that has NO HOTKEYS. I think the display should show the file is excluded. And,not with just some other indicator like you use (-------,=======,--o-o--- etc.). I think the word EXCLUDED should be included with the display of the filename.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: furqan and 68 guests