Not sure, if I understand completely, but you can
stack different hotstring variants:
Code: Select all
:B0*:wt ::
:B0*:t ::
input, var, V, {space}{enter}
len := (StrLen(A_thishotkey) = 8) ? StrLen(var) + 4 : StrLen(var) + 3 ; calculation could be generalized for more variants
Sendinput {BS %len%}hello %var%, nice to meet you{!}
return
But obviously,
w needs to be typed out first - since AHK can't tell the future...
(or should the character
w only be typed out after typing
tspace and otherwise always be suppressed ? of course, that could be done
One approach:)
But if the hotstring should generally work
in words, the
? option can help. (By default, hotstrings work only if they are at the start of a new word.)
For more complex or flexible situations, the
Regex approach - mentioned by flyingDman above - might be better suited, or other clever solutions...
original post has been modified