Live data from Hacker News

In Praise of AutoHotKey

hillelwayne.com

71–80 of 220 posts

Re: In Praise of AutoHotKey

#71
post #3

On macOS a similar tool is Keyboard Maestro ( https://www.keyboardmaestro.com/main/ ). I made over 1400+ macros in it over time that automate practically everything for me now. https://wiki.nikitavoloboev.xyz/macos/macos-apps/keyboard-ma...

It's a fantastic tool. I've been using it for years and I love it. Also works great with the Elgato StreamDeck.

Re: In Praise of AutoHotKey

#72
post #17

I've started[1] to do similar things on macOS using Hammerspoon[2]. So far I've set it up to let me: 1. Use shift when pasting something to simulate typing in the text instead, getting around websites that block pasting. 2. Use ";" as a hyper key. By holding it down and pressing another key, I can switch between specific programs without cycling. I can also use hjkl as arrow keys. 3. Automatically switch audio input…

> including treating my monitor as a speaker for some reason (it doesn't have built-in speakers).

This is quite common on HDMI monitors. Since the HDMI connection transmits both audio and video, the monitor just accepts both audio and video input. They would then have a 3.5-mm jack to allow you plug in an actual speaker or headphone to receive the audio output.

Re: In Praise of AutoHotKey

#73
Fun AutoHotKey abuse: Tom Scott's emoji keyboard[0]. It's every single emoji (at the time of recording) on 14 full keyboards with 1,000s of hand-placed bespoke stickers. He goes into more detail here[1], but it's beautiful.

[0]: https://www.youtube.com/watch?v=3AtBE9BOvvk [1]: https://www.youtube.com/watch?v=lIFE7h3m40U

Re: In Praise of AutoHotKey

#74
I learned programming with AutoHotkey when I was 15.

I first used it to automate grinding gold and items in a simple flash-based RPG for me and my younger siblings around ~2005. At first it just clicked certain locations that buttons would be on a fixed schedule to advance a quest to the end and repeat. But then, being a flash game after all, sometimes it would take a second to load the next screen which throws off the timings and breaks the sequence. So I changed it to wait for pixels to change color as an indication that something finished loading and to start the next sequence of clicks. But that didn't end up being very reliable because the colors & locations weren't always exactly the same, so I updated it to take a screenshot and use it to find the average color of an area of the game where a button would be which ended up being a much more reliable timing indicator. But then it was very slow/used a lot of CPU (and I needed all that CPU to go to running the flash game in a 2005 browser on a 2002 dell), and using a scripting language to sum up 100k pixels every frame just wasn't fast enough. So I wrote a single C function to do the color averaging on a byte buffer, copied the raw compiled machine code (as hex) into AutoHotkey and directly called it with DllCall to get the summed result: ah, much faster. But there was still an unreliable aspect where the position of the game in the browser window and the location of the browser window was fiddly to configure, and my siblings had a hard time getting it set up. It turns out IE used standard windows controls in the browser which (if you look in the right place) exposed the location of the flash bounding box, and with some calculations relative to the browser window I made all the click locations relative to the flash window, which solved that problem. It think it also supported browser scaling because we liked to play it at higher than 100% zoom.

I ended up being more interested in the programming than the game, and my first published project was an array library to make working with associative arrays (where each element is a separate variable myarray1, myarray2, myarray3 etc) easier with insert/delete/append etc operations, before AutoHotkey added true arrays and objects.

Then I went to university for chemistry for 2 years before getting my wits about me and realizing that I would probably be more interested in CS.

Re: In Praise of AutoHotKey

#75
I had a low paid data entry job one summer at university well over a decade ago that involved a tortuous process for digitising gas mains installation information. I discovered ahk and found I was able to install it, so I began to script the repetitive entry screens spread between multiple different programs. It allowed you to write a simple GUI form to collect various data up front. There was a lot of window picking and timers and sending of mouse clicks. It was really quite depraved but it worked. I could finish an hour's work in about 10 minutes and spent most of my time listening to Tom Stoppard plays.

I showed it to my immediate manager who I liked; they had a huge backlog and issues with the health and safety executive. She was interested and I thought I might get a slightly better low paid job maintaining my script, but alas the overworked, underskilled, and somewhat frightened IT person couldn't stomach the risk of getting in trouble for using it. So a hundred or so people went back to doing things 6 times as slowly and much more error prone-edly. It's stayed with me as some kind of lesson about inefficient use of human capital.

It was the first time I can remember really solving a problem I had with software. Thanks ahk. You beautiful ugly thing.

Re: In Praise of AutoHotKey

#76

Oh god, I remember EMC made us use this to manage their god-awful support system. One of the worst experiences of my life in IT. Not the fault of AutoHotKey but they used it to paper over the cracks in their massively flawed and sucky support system. The only thing I’ve used that is worse than the SAP GUI.

The AHK scripts you mention was probably the work of somebody who automated himself out of a job. Now upper managment thinks they would save $$$ by maintaining the AHK scripts instead of the actual underlying support system.

Re: In Praise of AutoHotKey

#78

Earlier quoted context omitted.

What are all these websites that prevent pasting? I noticed a few people are using tools to get around these.

A common one I see is when you're entering in bank account information and they force you to retype the account and/or routing number, even though you never typed it in to begin with because you just copy-pasted it from your bank's website :/

The worst is the banks that don’t let you copy it...

I don’t understand this insanity around bank account numbers... they should be treated as public info, they’re on every single check, anyone you’ve given a check to has your account number as does your employer...

Re: In Praise of AutoHotKey

#79
post #29

I absolutely love AutoHotKey. I've been using it for over 15 years. I used to use it to format my HTML back when i only used a Text Editor (similar to what this link is using for Markdown. I never use my right-control key so I map a lot of stuff to it. I used to have macros on rightctrl+b = surround the selection with and later (yes, it was that long ago). I had some nifty ones with logic for adding s (looking for @…

What are all these websites that prevent pasting? I noticed a few people are using tools to get around these.

It's an easy way to feel smart? I had to put up a fuss about this and cite NIST. My bank tried to do this, but it only works on the username field in chrome?

Re: In Praise of AutoHotKey

#80
post #17

I've started[1] to do similar things on macOS using Hammerspoon[2]. So far I've set it up to let me: 1. Use shift when pasting something to simulate typing in the text instead, getting around websites that block pasting. 2. Use ";" as a hyper key. By holding it down and pressing another key, I can switch between specific programs without cycling. I can also use hjkl as arrow keys. 3. Automatically switch audio input…

The usage of ; as a hyper key is fascinating. This is the first time I've seen someone do something with Hammerspoon that's actually tempting me to try it out. For paste blockers I've been using an Alfred workflow that types keys using AppleScript. It doesn't work with characters that require special input like ü, which is annoying, but it's sufficient for passwords. The benefit here is I'm not using up a global hotk…

Karabiner Elements is really popular for this use case. I have Caps set to be escape when pressed and Hyper in conjunction with pressing another key.
Post reply on HN