如何在 Autohotkey 中发送多行文本?

How do I send multilined text in Autohotkey?

此代码在按下 WINKEY + ALT + C 时粘贴 1 行文本:

#!c::
  SendInput, Some random text
Return

但我需要通过多行更大的文本。

我可以使用某种 \n 吗?如果我能在 txt 文件中有准确的文本并按原样粘贴 AHK,那就太好了。

几种方法。

  1. 您可以使用“延续部分”(explained about a third of the way down here)
#!c::
SendInput,
(
blah

    
    
    


blah
)
return
  1. 或者您可以使用显式转义换行符 `n:
#!c::
    SendInput, blah`n`n`n`n`n`nblah
return
  1. 或者您可以从磁盘读取文本文件并将其写出(但您可能必须更改 sendmode and/or 处理文本文件中需要转义的字符):
#!c::
    FileRead, blah, Path plus Name of Text File
    SendInput, %blah%
return