3

我希望使用带有 AutoHotKey 的命令“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 
4

1 回答 1

3

鲁贝托,

我在记事本中对此进行了测试,因此我更改了回车/换行以在记事本中正常工作。我没有逐个字符地发送文本,这很慢,而是将所有内容存储在变量中,如果您愿意,您也可以将它们直接存储在剪贴板中。试试这个,告诉我结果。在个人层面上,知识管理流程与这种方法的合作效果如何?

:*: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

哦,顺便说一句,我用 AutoHotKey_L 对此进行了测试,但它也应该与常规 AutoHotKey 一起使用。

于 2012-12-10T10:55:58.620 回答