HotString function Topic is solved

Propose new features and changes
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

HotString function

28 Sep 2017, 17:08

Is there any reason why HotStrings do not have function counterpart, or even anything else than the ::thx::Thanks! syntax? Or at least I failed to find any in-built, so please correct me if I am wrong and point the direction.

Hotstring function would allow to dynamically (again - if that's proper term) create them, from an array/object or reading a file. I have found usage for this many times, and I either used a library or made something on my own (but both were likely not as effective as inbuilt may be), or simply gave up on the idea. At the same time it is possible to create hotkeys in loop using a function.

Assuming my points are valid, I would love to see this implemented.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
egocarib
Posts: 100
Joined: 21 May 2015, 18:21

Re: HotString function

06 Oct 2017, 12:34

This kind of thing is currently supported by a user-released Dynamic Hotstrings library available for v1. I don't think anyone has translated it to work for v2 yet, last I checked.

Typically, I think that the intent of v2 is more to optimize the existing language, rather than build out or support entirely new features. However, in this particular case, I agree with SirRFI that it would make sense to add this functionality. Hotstrings are core to the original purpose and identity of autohotkey. Most casual users of autohotkey use it for hotstrings or very simple hotkey-launched code snippets. Making dynamic hotstrings a built in feature (with a hotstring function like the one SirRFI suggests above) seems like it would be quite useful to many typical AHK users and would support that core identity of the language.

For example, I work at a large software company where many users use autohotkey for small internal tools & helper utilities. Those users don't typically use many of the advanced features of the language, such as GUI or DllCall, but if dynamic hotkeys were a feature, I am sure that they would see a lot of use by the kinds of users I see here.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: HotString function  Topic is solved

26 Mar 2018, 05:26

Hotstring() was added in v1.1.28 and partially added (but broken) in v2.0-a089. It's fixed in v2.0-a90.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 19 guests