I want to execute a mouse click every day at a specific time.
I was able to find a template script doing this. But it told me to install v1 of autohotkey. That's what I did.
I would rather put Win 11 Pro on my other computer than v2 because this one is the most recent. Or if I put v1 on Windows 11 is it not a problem?
But if I install v2, the script below does not work? Do I need another script specific to v2 to make a mouse click every day at a specific time? https://www.autohotkey.com/board/topic/485-need-to-program-a-left-mouse-click-to-run-at-a-certain-time/
Code: Select all
#persistent
TargetTime = 1400 ; run at 2pm, which is 1400.
StringLeft, TargetDateTime, A_Now, 8 ; Put just YYYYMMDD into the variable.
TargetDateTime = %TargetDateTime%%TargetTime%
TimeUntilTarget = %TargetDateTime%
TimeUntilTarget -= %A_Now%, seconds
if TimeUntilTarget < 0
{
MsgBox The target time is already past!
return
}
TimeUntilTarget *= 1000 ; Convert to milliseconds.
SetTimer, ClickTimer, %TimeUntilTarget%
return
ClickTimer:
SetTimer, ClickTimer, off ; i.e. do only one click
MouseClick, left
return
Thank you for your clarifications. And good day.