From a49029f722a593898e3b4a056c26684e72db7981 Mon Sep 17 00:00:00 2001 From: guest3456 Date: Fri, 5 Jan 2018 09:36:00 -0500 Subject: [PATCH] JnLlnd's backreference bugfix https://autohotkey.com/boards/viewtopic.php?p=192691#p192691 --- Hotstring.ahk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Hotstring.ahk b/Hotstring.ahk index e2c64ea..cf8c404 100644 --- a/Hotstring.ahk +++ b/Hotstring.ahk @@ -135,8 +135,8 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){ toSend := v.label ;Working out the backreferences - Loop, % local$.Count() - StringReplace, toSend,toSend,% "$" . A_Index,% local$.Value(A_index),All + Loop, % local$.Count()+1 + StringReplace, toSend,toSend,% "$" . A_Index-1,% local$.Value(A_index-1),All toSend := RegExReplace(toSend,"([!#\+\^\{\}])","{$1}") ;Escape modifiers SendInput,%toSend% } @@ -164,4 +164,4 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){ ; This label is triggered every time a key is pressed. Hotstring("", "", "CALLBACK") return -} \ No newline at end of file +}