Send(Text,Mode="") {
If (Mode)
SendMode %Mode%
FoundPos := 0
Loop {
If (!FoundPos := RegExMatch(Text,"Ui).*\{_Sleep \d+\}",Match,++FoundPos))
Break
FoundPos += StrLen(Match) - 1
Send % RegExReplace(Match,"Ui)(.*)\{_Sleep \d+\}","$1")
Sleep % RegExReplace(Match,"Ui).*\{_Sleep (\d+)\}","$1")
}
Send % SubStr(Text,FoundPos)
}
Example:
Send("{_Sleep 2000}a{_Sleep 1000}b","Input")
No comments:
Post a Comment