mslonik / Hotstrings

AutoHotkey oriented GUI to Hotstrings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Import Hotkey: Allow full syntax to be imported

Gewerd-Strauss opened this issue · comments

Hello,

And here's FR2 I'd have.

The application already has a hotkey to copy the clipboard to the triggerstring-edit for setting up quicker hotstrings. This is helpful, but given that the application only allows text-replacement anyways, it should be entirely possible to parse complete valid syntax and prepopulate "triggerstring", "options" and "hotstring".

The only complicated thing that I personally wouldn't include are menu-hotstrings, but that's a comparatively smaller section. And even then it's helpful.

ahk is completely capable of parsing hotstring-syntax via regex, especially since we don't care about the possibility of multi-line code sections below the triggerstring in this application.


I personally f.e. use this regex

(?<Hotstuff>.*)`:`:(?:.*(?:`;(?<Comment>.*)?))?

as a means of identifying Hotkeys, Hotstrings and optional comments using ; CommentHere-syntax on the same line in my own projects when necessary. That isn't perfect for this request, because it doesn't parse out the replacement part as it was not necessary for me.
This is also the current progress I made myself on the task in Cf. #13, although I am still interested in how you do it in this application, because I am not dynamically displaying possible matches. No clue so far how to get that rolling :P


Thank you again for this application,
Sincerely,
~Gw

Hello Gw,

thank you for this feature request. I have still some doubts how it should work. To populate correctly new definition one have to specify library for new (triggerstring, hotstring) definition. From my own experience I'd prefare to take this step manually. The same challenge comes with options. The majority of (triggerstring, hotstring) definitions I apply have two forms:

"short", e.g. adm → ADM; no options
"long", e.g. adm/ → extended diagnostics module; option: *

So again I'd prefer myself to set up options manually.

If you wish we can discuss this and other issues on Signal communicator / messenger.

Kind regards, mslonik (🐘)

thank you for this feature request. I have still some doubts how it should work. To populate correctly new definition one have to specify library for new (triggerstring, hotstring) definition.

But that is the case in the current instance as wlel. Right now, you have the shortcut to copy clipboard content to "Enter hotstring".
image

What I'd ask is that I can do the following:

  1. type down :*c0:dh::A_Hour:A_Min:A_Sec
  2. highlight it
  3. press !q
  4. get the selected text (preferably while restoring the clipboard)
  5. parse it out into options, triggerstring and replacement
  6. prefill the fields
  7. and let the user take care of the rest

I am not asking to expand this into a complex syntax to allow for menu-hotstrings.

definitions I apply have two forms:

"short", e.g. adm → ADM; no options
"long", e.g. adm/ → extended diagnostics module; option: *

I am not entirely sure what this has to do with it, might you elaborate?


I just noticed you recently updated, It might have been that you removed that feature, idk. I am running version 3.5.5, from the cutting edge-branch of back when we first talked.

Addendum cuz apparently I unhelpfully forgot to put this into the first reply

Additionally, we can set up a voice meeting for this if I can't convey it per text properly.

However, I am utterly busy at the moment, so I won't be able to do so any sooner than 16.02.2022, and even then I might have to reschedule.

Hi again,
at first thank you for all provided explanations. It is appreciated and now I think it's clear to me.

The title of this issue is

Import Hotkey: Allow full syntax to be imported

(I've made bold underline above on purpose). Such functionality is already implemented in Hotstrings application since... a long time. Please just have a look into menu:

Libraries → Import from .ahk to .csv

This option will import any file containing only static hotstring definitions into format of Hotstrings application.

If this is what was intended, please close this Issue. If not, let me know.

By the way, I strongly recommend you to update Hotstrings to current stable release (3.6.3) which brings many enhancements and bug fixes.

(You can do it directly from Hotstrings application: menu Application → Version / Update).

Huh. After a lot of back and forth on my end I fetched the current version from GH onto a fresh install.

The problems:

  1. As far as I could (not) find it, there is no option to set the library-folder elsewhere other than the pre-picked location in Appdata/Roaming/Hotstrings. Therefore, I cannot point the script anywhere else.
  2. The ini-file for the script (also located at appdata/roaming/hotstrings) has the same problem.
  3. the first idea was to check if the scripts checks its ScriptDir first. However, copying both files over there does not result in any difference. If Ini and Libraries are not present in Roaming, they are created at startup.
  4. The reload options trigger an Error "script file not found", if the absolute path to it seems to have spaces in it:
    image

I sincerely hope this is not intended behaviour, because I both foolishly lost my own, working version, and well.. it's evidently not working, even on a fresh install - which is curious.


Also tested on a completely separate drive at root level for no reason whatsoever, same issues.

Hello GW,

now I write just to let you know I'll try to address the issue related to location of the files (config.ini, languages, Libraries)as my top priority.

Hello GW,
regarding your last issue, I've fixed it with this commit: 4cfca78

(Later it will be integrated into next stable release). By the way I've found 2x other issues: positions in Tray menu doesn't make much sense and icon file cannot be easily downloaded from within GitHub. To be fixed later.

Hello GW,

from my perspective import of "full syntax" is available. The other issues you've described are now separated into dedicated issues. I'm willing to close this issue, if you don't mind.

We can close it then.

I might disagree regarding the import of full syntax.

But the issue here lies on me, if the current branch differs in that regard with my older instance.
Given that I currently cannot check the newest patch due to lack of... (well, time, a working computer and storage), I will check back on it once I can.


(To say the least, my main storage partition decided to dive off the digital cliff and I am in the middle of exam prep with half my data lost. This has moved to probably the lowest possible priority for me, which is also why I haven't responded in days.).

Thankfully i keep backups off-site, but there is still a bit I've negligently failed to back up recently.

Let's just say I am "mildly irritable" currently.