本文介绍了重新启动自动热键脚本的热键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说我正在运行一个自动热键脚本C:\path\to\my\script
.有没有一种方法可以定义一个重新启动它的热键?
Say I have an autohotkey script C:\path\to\my\script
running. Is there a way to define a hotkey that re-starts it?
推荐答案
为了防止重复实例,我通常不重新启动脚本,而是使用内置函数重新加载.我用 + + + 启动它,并使用 + + + 编辑AHK的主要脚本.
In order to prevent duplicate instances, I normally do not re-launch a script but use the build-in function Reload. I launch this with +++ and use +++ to edit the main AHK script.
^#!r::Reload
实际上,我的脚本如下:
Actually, my script looks like this:
^#!r::
Send, ^s ; To save a changed script
Sleep, 300 ; give it time to save the script
Reload
Return
^!#e::Edit
事实上,在脚本的顶部,我一直以这种方式以视觉和音频的方式指示脚本已重新启动:
As a matter of fact, all the way at the top of my script I have this to give me a visual and audio indication that the script was restarted:
#SingleInstance Force
#installKeybdHook
#Persistent
Menu, Tray, Icon , Shell32.dll, 25, 1
TrayTip, AutoHotKey, Started, 1
SoundBeep, 300, 150
Return
这篇关于重新启动自动热键脚本的热键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!