【问题标题】:How do I send multilined text in Autohotkey?如何在 Autohotkey 中发送多行文本?
【发布时间】:2021-12-04 01:45:35
【问题描述】:

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

#!c::
  SendInput, Some random text
Return

但我需要传递一个更大的文本,多行。

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

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    几种方法。

    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 和/或处理文本文件中需要转义的字符):
    #!c::
        FileRead, blah, Path plus Name of Text File
        SendInput, %blah%
    return
    

    【讨论】:

      猜你喜欢
      • 2015-02-08
      • 2018-01-24
      • 2016-04-18
      • 1970-01-01
      • 2013-03-08
      • 2012-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多