AutoHotKey - 全选>复制>插入AHK脚本>将复制的测试粘贴到AHK脚本区域

时间:2012-12-09 23:10:58

标签: 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 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 

1 个答案:

答案 0 :(得分:3)

Ruberto,

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

:*: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。我使用AutoHotKey_L进行了测试,但它也适用于常规的AutoHotKey。