Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post your working scripts, libraries and tools
Guest

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Guest » 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

Post by Guest » 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

Post by nicrox » 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
Kellyzkorner_NJ
Posts: 9
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 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.
Kellyzkorner_NJ
Posts: 9
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 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
FanaticGuru
Posts: 1190
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by FanaticGuru » 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

[Function] Timer - Create and Manage Timers
Kellyzkorner_NJ
Posts: 9
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 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
Kellyzkorner_NJ
Posts: 9
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 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.
FanaticGuru
Posts: 1190
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by FanaticGuru » 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

[Function] Timer - Create and Manage Timers
Kellyzkorner_NJ
Posts: 9
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 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!
Kellyzkorner_NJ
Posts: 9
Joined: 20 Oct 2017, 18:33

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 02 Jan 2018, 21:10

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

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post by Kellyzkorner_NJ » 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

Post by Bredda » 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?
Post Reply

Return to “Scripts and Functions”