例如,这将用 test 替换所有单词 test。
:*?:test::test2
它有效,但我希望它突出显示“test2”给定的单词。
答案1
尝试以下方法:
#NoEnv
#SingleInstance Force
; Create a group of the windows you want to execute this or more hotstrings in the auto-execute section (top of the script):
; ahk_group Editors_Group
GroupAdd, Editors_Group, ahk_class Notepad
GroupAdd, Editors_Group, ahk_class Notepad2
GroupAdd, Editors_Group, ahk_class Notepad++
GroupAdd, Editors_Group, ahk_class WordPadClass
; ...
RETURN ; === end of auto-execute section ===
; and use the #IfWinActive directive to make the hotstrings context-sensitive:
#IfWinActive, ahk_group Editors_Group
:*?:test::
Send {Text} test2
Send {Blind}{Text}testing
SendInput, ^+{Left}{Left}^+{Right}
return
; ...
#IfWinActive ; turn off context sensitivity
看群组添加,#IfWinActive和发送在文档中。