End characters do not get read after trigiring autotext Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

End characters do not get read after trigiring autotext

13 Apr 2018, 10:59

Help. As a translator, I use an extensive autohotkey script for autocorect and text expansion and to insert common diacritics and special characters in my Portuguese language translations.
As an example,

Code: Select all

 ::alguem::alguém
replaces “alguem” with “alguém”, inserting the diacritic.
And I also use some sequential keystroke codes for characters that normally require shift, like

Code: Select all

 :?*:,.::?
to insert the question mark.
I have used these for years, and in the past could input the keystrokes “alguem,.” and end up with the text “alguém?” But now after setting up a new computer and installing Autohotkey and my autocorrect script, inputting the same key sequence produces this “alguém,.”
After AHK uses the comma keystroke to trigger the “alguém” correction, it does not count toward the second correction that would insert the ?.
Can someone tell me what to do so the end characters still count for future substitutions after triggering a former one?
Or point me to a former discussion of similar issues? Thanks.
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 11:58

Strange, this works fine for me when I try it. What if you add * to the options of the first hotkey, does that help?
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:03

Yes, adding the asterisk option to the first one to permit suffixes would help for this specific combination, but I have several hundred entries and not all them will work properly with suffixes allowed.
But like you say, for me it used to work fine also, but am thinking it has to do with something about the updated versions of AHK.
Maybe I need an install of an older version.
I was hoping maybe it is some configuration that needs tweaking in my newer installations.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:11

The asterisk is not about suffixes/hotstrings in another word, but about a not required ending character. The ? is "to permit suffixes".
That said, your hotstrings work for me without a problem on the newest AHK version 1.1.28.02
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:22

I use both the * and the ? options in many of my hotstrings, and in my way of looking at how they work, the * allows suffixes because I can continue to add letters after the hotstring triggers, and the ? allows prefixes because I can type other letters before the hotstring, and it still triggers and works, right?
I don't know how to find what version I'm running.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:26

Oh yeah, I meant prefixes, sorry. Run this to get some version info:

Code: Select all

Msgbox % "v" A_AhkVersion " " (A_PtrSize = 4 ? 32 : 64) "-bit " (A_IsUnicode ? "Unicode" : "ANSI")  " Admin " A_IsAdmin " on " A_OSVersion
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:39

Just to be sure you understand what my problem is, with the script that contains these two hotstrings running, if I type the first hotkey and a space to triger it, then backspace to clear the space and type the second hotkey, they both work fine.
The problem is when the comma that triggered the first hotstring is already part of the second hotkey.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:42

Yes, when I type “alguem,.”, I get “alguém?” - just like MaxAstro above, I think.

Do you have some #Hotstring directive in your script that changes the default behaviour? (Compare https://autohotkey.com/docs/Hotstrings.htm#EndChars)
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:52

Now I am really getting baffled, because I just discovered that here in this window it works perfectly: alguém? and in the browser command line it also works, but in MSWord, notepad, MemoQ and other places I have tested it, it still does not act right.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 16:56

If you are running some 1.1.27.x version - I think there were some hotstring problems with Excel, perhaps with other applications, too. But these changes have been rolled back in 1.1.28, afaik.

Edit: I just checked. For me, it also works in MS Word. So what AHK version are you running?
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 17:18

v1.1.28.00 32-bit Únicode Admin 0 on 10.0.16299
I had been running the 64 bit version and switched to the 32 bit in hopes it might change something, but it did not.
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 17:21

Both of my computers are running 64 bit Windows 10.
The older one, where AHK and my autocorect script had worked fine since 2013, was reformatted and AHK re-installed, and has the same problem now at the new one.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: End characters do not get read after trigiring autotext  Topic is solved

13 Apr 2018, 17:22

Your version could well be the problem. I would try 1.1.28.02 - I personally use the 64 bit version on Win 10.
In 1.1.28.01 there were still some hotstring related changes/rollbacks: https://autohotkey.com/docs/AHKL_ChangeLog.htm ("Reverted hotstring reset behaviour to pre-v1.1.28.00.")

You can just run the installer and update/change your version.
sik
Posts: 22
Joined: 07 Sep 2015, 10:59

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 17:30

Great! Switching to 1.1.28.02 took care of the problem. Thanks for the help!
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: End characters do not get read after trigiring autotext

13 Apr 2018, 17:37

sik, just FYI, I ran your code in MS Word 2016, AHK_L 1.1.28.02 U64, Win7 64-bit, and it works fine.
Regards,
burque505

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Kodakku and 365 guests