How to waste a couple of hours

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
SpaceMoth
Posts: 11
Joined: 29 Apr 2016, 07:05

How to waste a couple of hours

20 Oct 2022, 15:12

I just had a facepalm moment that I feel compelled to share.

I've been meaning to learn AHK properly and rewrite my large kludgy script for ages. So I just started delving into the docs with that aim in mind, and one of the first things I came across was the console and Lines most recently executed. How exciting I thought. Oh look, you can refresh the view. Oh dear, why is that hotkey definition running constantly. Wow, every few ms, that's a problem!

That piece of code was the only place I'd used expression syntax, so I've misunderstood something there. Sorting out my ignorance of legacy and new syntax was the main thing I wanted to learn, so this is fortuitous. Go and read the docs. Notice the v1/v2 toggle in the page header. What version have I got? Right, better Google v2 then. Decide I should switch. Read the forums. Decide I shouldn't switch. Back to the docs. #IfWinActive, #If <expr>... why did I use one rather than the other when I wrote this bit years ago? Make some test files. Why does the console show the code running constantly here but not there? Or when I define these couple of hotkeys but not those? Time passes... Change the hotkey to a different key. All is well! Change it back :-( Copy the line 10 times to define hotkeys for all the function keys. No good. Comment them out one by one. No good... Until I comment out F5. What the...? Why F5? Why that ... oh.

*facepalm*

Return to “General Discussion”

Who is online

Users browsing this forum: ntepa and 5 guests