Auto-replace hotstrings misfiring

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AHKxx
Posts: 75
Joined: 26 Feb 2014, 01:37

Auto-replace hotstrings misfiring

20 Apr 2021, 08:21

I have a script with about 200 hotstring abbreviations that I've accumulated over the years. The script worked as expected with Windows 8.1. But with W10 on a different device, they inconsistently misfire.

They are all in a simple list. None of the hotstrings and their replacement text are long, and most are quite short.

Code: Select all

::becc::because
::cvcv::coronavirus 
::fbfb::Facebook
::msms::Microsoft 
::hshs::hotstring
What happens is, after the hotstring and the ending character are typed, the replacement text will have an extraneous space in it:

Code: Select all

becau se
coron avirus
Fa cebook
Micro soft
hots tring
It's inconsistent where the space is, or which string will do it under which circumstances. It appears random.

Once a string misfires, it's very rare to get it to do it again right away. But the most common ones I use all eventually misfire again.

I've updated to the most recent AHK but that didn't have any effect.

Can there be too many strings in a script? Would it help to split them into multiple scripts? This script is not the only script I have running in memory at the time. But the total amount is about the same as with 8.1, and none of the others show any signs of problems.

Anyone have any idea what might be behind this?

Thanks much.
User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: Auto-replace hotstrings misfiring

20 Apr 2021, 09:45

You probably have conflicting code. It's easy to debug, because you can remove lines until the problem is solved. You will have then pinpointed the problem. Ensure that no other scripts are running at the same time.
AHKxx
Posts: 75
Joined: 26 Feb 2014, 01:37

Re: Auto-replace hotstrings misfiring

17 Jul 2021, 16:41

Hello. Belated thanks for your reply.

I have tried what you suggested. But there doesn't seems to be any conflict that I can identify. What kind of "conflict" could it be?

Even with a greatly reduced number of abbreviations, the ones that remain eventually misfire. It's happening on two different Windows 10 devices, with the same inconsistency, sometimes a given abbreviation works as expected, other times there is a space inserted randomly into the hotstring, as shown in the OP above.

Any other ideas what would be causing this?
User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: Auto-replace hotstrings misfiring

18 Jul 2021, 06:48

So you are saying that your script as shown also does not work properly, by itself with no other code and no other scripts running. I imagine that you might have other software that is also working with the keyboard or a hook, and inserting spaces. There are likely additional possibilities. If your script as shown does not work, then close all running scripts and programs, including non-Windows tray-resident programs, and try again. I would also test it on a second computer, to see if it works there. I wonder if your own keyboard is somehow inserting an extra space. Try just the following.

Code: Select all

SendMode Input
:CT:fbfb::Facebook

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl and 248 guests