3 ms·
AutoHotkey is an ugly language to write in, but oh boy is it useful for gluing disparate Windows actions together. Theoretically you can do the same thing that
by sireat 7y ago
AutoHotkey is an ugly language to write in, but oh boy is it useful for gluing disparate Windows actions together.
Theoretically you can do the same thing that AHK does in a .net language or even Powershell but AHK is just easier to whip up something very quickly.
Still I wish there were better Python wrappers for Windows automation.
- nickjj 7y ago> Theoretically you can do the same thing that AHK does in a .net language or even Powershell but AHK is just easier to whip up something very quickly. This is exactly how I see it too. 10+ years ago I would have written a C# app to do something that I can now do in AHK. Of course there's limitations (I wouldn't write a super intensive native app in AHK) but for little workflow optimizations it's so good. For example, I wanted a quick and dirty way to grab the hex color under my mouse cursor and copy it to my clipboard. With AHK it was: #h:: MouseGetPos, MouseX, MouseY PixelGetColor, color, %MouseX%, %MouseY% StringLower, color, color clipboard := SubStr(color, 3) And now when I press Windows + h as a global hotkey it does what I want. I set it up to start when Windows starts and it uses 1.5MB of memory. Can't really beat that for overall efficiency (few minutes of coding, doesn't take up much resources, etc.). A while back I wrote a blog post on using AHK for defining global hotkeys. I still use that method today. If anyone cares, that's at: https://nickjanetakis.com/blog/remap-and-set-global-hotkeys-on-windows-10-with-auto-hotkey https://nickjanetakis.com/blog/remap-and-set-global-hotkeys-...
- kiddico 7y agoYour hex snippet produced my usual outcry when I read other's AHK scripts: "Wait, you can do THAT?!" It's been added to my growing toolbox(which I lovingly call i3_emulator.exe), thanks!
- nickjj 7y agoThe fun thing about it is I wouldn't classify myself as an AHK developer. I just picked apart a couple of scripts that I found on Google. You can kind of understand what's going on with general programming experience and double checking their documentation. In the hex code example it almost reads like pseudo code. Get the mouse position and store it into X / Y variables, grab the color under the mouse position, make it all lower case, copy it to the clipboard but trim out a few extra characters that was returned by a previous step. How is your i3 emulator going? I tried that one tiling window manager AHK script (bug.n) but found it to be a little too buggy to use.
- glaberficken 7y agoI have used both AHK and AutoIt and find AutoIt much simpler to understand (and also has clearer documentation). https://www.autoitscript.com/site/autoit/ https://www.autoitscript.com/site/autoit/