Hello
once i run a AHK script ,
The hotkey which is used to run the script should not be triggered for the next one hour
That is if I press the hotkey now a certain action will be performed ( lets say "write to file" )
But if I press that hotkey again after 5 mins for example , nothing should happen
Please Help
Time Specific Hotkey
Re: Time Specific Hotkey
Based on your previous questions which you posted in 'Ask For Help' (AHK v1), are you aware you are posting in the area for AHK v2 questions?
If yes, please confirm.
If no, and your question is still about AHK v1, we can move your topic.
If yes, please confirm.
If no, and your question is still about AHK v1, we can move your topic.
Last edited by gregster on 07 Jul 2021, 13:41, edited 1 time in total.
Reason: more sense
Reason: more sense
Re: Time Specific Hotkey
Code: Select all
#Requires AutoHotkey v2.0-a138-7538f26f
q::
hotkeyFunction(ThisHotkey) {
writesToFile()
Hotkey(ThisHotkey, (*) => '') ; make it not do anything
SetTimer(() => Hotkey(ThisHotkey, hotkeyFunction), -60 * 60 * 1000) ; reenable after 1h
}
writesToFile() {
; do ur writing
}
Re: Time Specific Hotkey
@gregster
I am sorry I do not understand your question , could you please elaborate ?
I am fairly new to this forum
I am sorry I do not understand your question , could you please elaborate ?
I am fairly new to this forum
Re: Time Specific Hotkey
@swagfag
Thank you
I will try that
Thank you
I will try that
Re: Time Specific Hotkey
Sure, that's why I am asking. AutoHotkey's stable release is v1 (latest: v1.1.33.09). It's "Ask For Help" forum is this: https://www.autohotkey.com/boards/viewforum.php?f=76 - there you posted your other questions.
Now you posted in the "AutoHotkey v2 Help" subforum - it's specifically about AHK v2. That new version is still an alpha release; it introduces a number of improvements, but also many script-breaking syntax changes, compared to AHK v1. (v2 will get into beta stage soon.)
If you are interested in v2, that's totally fine. But I noticed that many new users often post erroneously in the v2 section, and get code that they can't use with AHK v1.
Since you already got a v2 answer, I would now like to keep this topic here. If your question was actually meant for v1 help, please re-post there.
Now you posted in the "AutoHotkey v2 Help" subforum - it's specifically about AHK v2. That new version is still an alpha release; it introduces a number of improvements, but also many script-breaking syntax changes, compared to AHK v1. (v2 will get into beta stage soon.)
If you are interested in v2, that's totally fine. But I noticed that many new users often post erroneously in the v2 section, and get code that they can't use with AHK v1.
Since you already got a v2 answer, I would now like to keep this topic here. If your question was actually meant for v1 help, please re-post there.
Re: Time Specific Hotkey
@gregster
Thank you for the clarification
I was not aware
I will re-post my question in the AHK V1 forum
Thank you for the clarification
I was not aware
I will re-post my question in the AHK V1 forum