我一直在尝试找出如何更快地插入/扩展长文本。我当前使用的击键方法非常耗时,因此我宁愿避免这种操作。
现在,我正在使用以下方法:
::abc::all bad cats
Run Code Online (Sandbox Code Playgroud)
或更长的文字:
::li::
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Run Code Online (Sandbox Code Playgroud)
但是第二种方法有点慢。
关于如何避免这种缓慢扩展方法的任何建议?也许通过使用剪贴板从AHK脚本复制和粘贴?
尝试这个:
::li::
ClipSaved := ClipboardAll ; save the entire clipboard to the variable ClipSaved
clipboard := "" ; empty the clipboard (start off empty to allow ClipWait to detect when the text has arrived)
clipboard = ; copy this text:
(
Lorem ipsum dolor ...
line2
..
)
ClipWait, 2 ; wait max. 2 seconds for the clipboard to contain data.
if (!ErrorLevel) ; If NOT ErrorLevel, ClipWait found data on the clipboard
Send, ^v ; paste the text
Sleep, 300
clipboard := ClipSaved ; restore original clipboard
ClipSaved = ; Free the memory in case the clipboard was very large.
return
Run Code Online (Sandbox Code Playgroud)
https://autohotkey.com/docs/misc/Clipboard.htm
| 归档时间: |
|
| 查看次数: |
6357 次 |
| 最近记录: |