如何在Autohotkey中发送多线文本?当按下WINKEY + ALT + C
问题描述:
这段代码粘贴一个1行文本:如何在Autohotkey中发送多线文本?当按下WINKEY + ALT + C
#!c::
SendInput, Some random text
Return
但我需要过去更大的文本,多行。
是否有某种\n
我可以使用?如果我能够在txt文件中获得确切的文本并将其按原样粘贴,那将非常棒。
答
几种方法。
你可以使用一个“延续部分”(解释一下了三分之一到这里https://autohotkey.com/docs/Scripts.htm)
#!c::
SendInput,
(
blah
blah
)
return
或者你可以使用显式转义换行符`N:
#!c::
SendInput, blah`n`n`n`n`n`nblah
return
或者您可以从磁盘读取文本文件并写出来(但您可能需要更改sendmode和/或处理文本文件中需要转义的字符):
#!c::
FileRead, blah, Path and Name of Text File
SendInput, %blah%
return