Created
December 9, 2021 16:39
-
-
Save s-show/3077002eee1c266bc3cf7d835f5682bd to your computer and use it in GitHub Desktop.
ブログ記事用()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
Title: 選択した文字列を'('等で囲む | |
Usage: 文字列を選択→ctrl-,を押す→続けて入力した文字で囲む | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
*/ | |
^,:: | |
backup = ClipboardAll | |
Clipboard = | |
Send, ^c | |
ClipWait, 1 | |
imeStatus := IME_GET() | |
if ErrorLevel = 0 | |
{ | |
Input, inputText, I L1 T1,{Esc}, (,[,`{,',",``,-,_,=,`%,`#,`*, ,| | |
If ErrorLevel = Match | |
{ | |
IME_SET(0) | |
If inputText = [ | |
{ | |
Send,{[} | |
Send,^v | |
Send,{]} | |
Sleep 200 | |
} | |
Else if inputText = ( | |
{ | |
Send,{(} | |
Send,^v | |
Send,{)} | |
Sleep 200 | |
} | |
Else if inputText = { | |
{ | |
Send,{{} | |
Send,^v | |
Send,{}} | |
Sleep 200 | |
} | |
;スペースは`=`による条件判定ができないため、変数の型で判定している。 | |
Else if inputText is space | |
{ | |
Send,{Space} | |
Send,^v | |
Send,{Space} | |
Sleep 200 | |
} | |
;`#`は個別に条件指定しないと動かない | |
Else if inputText = `# | |
{ | |
Send,{`#} | |
Send,^v | |
Send,{`#} | |
Sleep 200 | |
} | |
Else | |
{ | |
Send,%inputText% | |
Send,^v | |
Send,%inputText% | |
Sleep 200 | |
} | |
} | |
} | |
Clipboard = %backup% | |
IME_SET(imeStatus) | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment