Autohotkey 自动热键-选择全部>;复制>;插入AHK脚本>;将复制的测试粘贴到AHK脚本区域

Autohotkey 自动热键-选择全部>;复制>;插入AHK脚本>;将复制的测试粘贴到AHK脚本区域,autohotkey,Autohotkey,我希望使用带有自动热键的命令“rwn”来选择全部并从文本框复制现有文本-插入预定义脚本-然后将复制的文本中途插入预定义脚本 这就是我到目前为止所做的——我尝试过几种不同的变体,但似乎都不起作用 ::rwn:: { Send ^a Sleep 30 Send ^c } 1 - Validated Customer Details:`n Building: `n Level & room: `n Contact Office: x`n Contact Mobi

我希望使用带有自动热键的命令“rwn”来选择全部并从文本框复制现有文本-插入预定义脚本-然后将复制的文本中途插入预定义脚本

这就是我到目前为止所做的——我尝试过几种不同的变体,但似乎都不起作用

::rwn::
{
Send ^a
Sleep 30
Send ^c
}
1 - Validated Customer Details:`n     Building: `n     Level & room: `n     Contact Office: x`n     Contact Mobile: 04`n`n2 - Original request information:`n     
{
Send ^v
} 
`n`n3 - New Restoration OR Existing Problem:`n     `n`n4 - Work Details:`n     `n`n5 - Remote Access:`n     Attempted (SCCM) Successful (SCCM) Not Available`n`n6 - Can be Resolved 

directly by me?`n     YES NO`n`n7 - Capture User Interaction`n     `n`n8 - Customer's understanding of resolution:`n     `n`n9 - KM Record potential:`n     Yes No`n  
return 
鲁贝托

我在记事本中对此进行了测试,因此我更改了回车/换行符,以便在记事本中正常工作。我将所有内容都存储在变量中,而不是一个字符一个字符地发送文本(这很慢),如果您愿意,也可以将它们直接存储在剪贴板中。试试看,告诉我结果。 就个人而言,知识管理过程与这种方法的配合情况如何

:*:rwn:: ; Added * so you don't have to press Enter after rwn
Send ^a ; Select All
Sleep 30 ; Wait 30 ms.
Send ^c ; Copy incident text to clipBoard
ClipWait ; Wait for clipboard to fill
; Define 3 variables with text, pasting text from the clipboard is much faster than sending text. Since I tested it in Notpad, I had to use `r`n Carriage Return, New Line
Text1 = 1 - Validated Customer Details:`r`n     Building: `r`n     Level & room: `r`n     Contact Office: x`r`n     Contact Mobile: 04`r`n`r`n2 - Original request information:`r`n`r`n
Text2 = %ClipBoard%
Text3 = `r`n`r`n3 - New Restoration OR Existing Problem:`r`n`r`n`r`n4 - Work Details:`r`n`r`n`r`n5 - Remote Access:`r`n`r`n`r`nAttempted (SCCM) Successful (SCCM) Not Available`r`n`r`n6 - Can be Resolved directly by me?`r`n     YES NO`r`n`r`n7 - Capture User Interaction`r`n     `r`n`r`n8 - Customer's understanding of resolution:`r`n     `r`n`r`n9 - KM Record potential:`r`n     Yes No`r`n
ClipBoard = %Text1% ; Store fixed text 1 in clipboard
Send, ^v ; Paste clipboard content
ClipBoard = %Text2% ; Store incident text 2 in clipboard
Send, ^v ; Paste clipboard content
ClipBoard = %Text3% ; Store fixed text 1 in clipboard
Send, ^v ; Paste clipboard content
return

哦,b.t.w.我用自动热键测试了这个功能,但它也可以用普通的自动热键。

仍然不太清楚。你想要1。选择所有文本,2。将文本复制到剪贴板,3。使用高亮显示的文本发送一个或多个预定义的文本行(替换原始文本),4。将剪贴板中的原始文本粘贴到先前添加的文本5下。用一些预定义的结束文本行附加粘贴的文本。这是正确的吗?嗨,罗伯特,谢谢。这是一个很好的方法,变量确实使运行命令时速度更快。