2012-12-09 133 views
2

我期待使用命令「RWN」在AutoHotkey選擇所有和複製現有的從文本框中的文本 - 插入預定義腳本 - 然後將複製的文本中途插入到預定義的腳本中。AutoHotkey的 - 選擇所有>複製>插入AHK腳本>粘貼複製到測試腳本AHK面積

這是我迄今爲止 - 我在幾個不同的變化嘗試過,但似乎沒有工作。

::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 
+0

還不是很清楚。您希望1.選擇所有文本,2.將文本複製到剪貼板,3.使用突出顯示的文本發送一個或多個預定義文本行(替換原始文本),4.將剪貼板中的原始文本粘貼到先前添加的文本下,5.將粘貼的文本附加一些預定義的完成文本行。它是否正確? –

回答

2

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。

+0

嗨羅伯特,謝謝你這樣做,並且變量在運行命令時使它更快。 – ruberto

相關問題