Skip to content

Instantly share code, notes, and snippets.

@tex2e
Created June 18, 2020 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tex2e/8d2fd1598af4c3fb3123f8bb83616c08 to your computer and use it in GitHub Desktop.
Save tex2e/8d2fd1598af4c3fb3123f8bb83616c08 to your computer and use it in GitHub Desktop.
; Excelの複数行の結合セルに貼り付ける
!+v::
Critical
SetKeyDelay, 0
Loop, parse, clipboard, `n, `r
{
line := StrReplace(A_LoopField, "`t")
Send {F2}%line%{Enter}
}
Return
;;
;; 選択文字を「"」「'」「()」で囲む処理
;;
F13 & ':: Enclose("'", "'")
F13 & ":: Enclose("""", """")
F13 & (:: Enclose("(", ")")
F13 & ):: Enclose("(", ")")
Enclose(begin, end) {
oldClipboard = %Clipboard%
Clipboard =
Send, ^c
ClipWait
If (!ErrorLevel) {
StringRight, LastChar, Clipboard, 1
If (LastChar != "`n") {
WinGetTitle, CurrentWinTitle
Clipboard = %begin%%Clipboard%%end%
ClipWait
WinActivate, %CurrentWinTitle%
Send, ^v
Sleep 150
}
Clipboard = %oldClipboard%
}
Return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment