如何在 AHK 中编写一个脚本来粘贴文本,等待一分钟,然后再次粘贴?
AHK=自动热键
不是为了垃圾邮件,而是为了我自己的网络项目之一。
我应该指定:脚本需要粘贴文本,按回车键,等待一分钟,然后再次粘贴。如果不按回车键,则不起作用。
最佳答案
对于这样的事情,SetTimer 比 sleep 更好。
#Persistent
; Put this wherever you want, like inside a hotkey
; Either set the clipboard to some text, or just remove this
; to use what's already there
Clipboard = This is some text to paste
SendInput ^v{Enter}
last_text := Clipboard
SetTimer, RePaste, 60000
return
RePaste:
; The clipboard can change in a minute, right?
; so we use the text we had before
tmp := clipboard
Clipboard := last_text
SendInput ^v{Enter}
; And restore what the user had
Clipboard := tmp
return
; Put this somewhere, like in a hotkey, to turn off the timer
SetTimer, RePaste, off
关于wait - 如何在 AHK 中编写一个脚本来粘贴文本,等待一分钟,然后再次粘贴?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13660459/