Consider this hotstring, which is a grammar-relevant autocorrect item:
Code: Select all
::because of it's::because of its
I have a function, as seen here:
https://www.autohotkey.com/boards/viewtopic.php?f=83&t=120220&p=543210#p542691
that does this. The relevant part of the code is here:
Code: Select all
; v2 code
; please assume that the trigger/hotstring is "trigger" and the expansion/replacement text is "replace."
; Only select and replace rightmost necessary chars.
trigL := StrSplit(trigger)
replL := StrSplit(replace)
Global ignorLen := 0
Loop Min(trigL.Length, replL.Length) ; find matching left substring.
{ If (trigL[A_Index] = replL[A_Index])
ignorLen++
else
break
}
; select trigger that was just typed and get trigger text
SendInput("{Shift down}{Left " (TrigLen - ignorLen) "}{Shift up}{Ctrl down}x{Ctrl up}")
Just an idea!