Autohotkey에서 지정된 텍스트를 어떻게 자동 강조 표시합니까?

Autohotkey에서 지정된 텍스트를 어떻게 자동 강조 표시합니까?

예를 들어, 이는 모든 단어 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그리고보내다문서에서.

관련 정보