Live data from Hacker News

In Praise of AutoHotKey

hillelwayne.com

81–90 of 220 posts

Re: In Praise of AutoHotKey

#81

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…

> It was really quite depraved but it worked

> but alas the overworked, underskilled, and somewhat frightened IT person couldn't stomach the risk

this seems like a reasonable call to me.

Re: In Praise of AutoHotKey

#82
post #80

Earlier quoted context omitted.

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.

The downside is Karabiner Elements requires installing a kext, and macOS Catalina periodically shows warnings saying the kext is a legacy extension.

Re: In Praise of AutoHotKey

#83
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…

Using ; as a hyper key blew my mind, like the article recently about how a certain developer calls all of his scripts ',something' so if he want to run a cli command of his, pressing comma then tab will show only his scripts, so ',py(tab)' won't have 15 pythons in it.

Re: In Praise of AutoHotKey

#84
Something I don't see mentioned in this thread is that Autohotkey is more than just hotkeys. It can also create basic GUIs using native Windows widgets, and is probably the fastest way of producing a GUI on windows (the resulting script can be bundled into an .exe file)

Re: In Praise of AutoHotKey

#85
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.

For a really stupid example, part of my job involves originating truck shipments. One carrier we use has a website that prevents pasting on their web form to generate a bill of lading. Because forcing me to type in an address is much less likely to cause errors than pasting in whatever address I had copied.

Funnily enough (in a sad way), 40% of the JS load on that page appears to be anti-pasting logic & supporting libraries. It appears to be developed in-house, since the scripts aren't obfuscated and a quick search of duckduckgo didn't match any open-source libraries that I could find. If they weren't reliably the cheapest carrier with the fewest issues I would raise a stink, but it's not worth it. That, and I just bypassed this 'feature' with a very similar AHK script, and their website has a very nice UI besides that issue.

Re: In Praise of AutoHotKey

#86
post #84

Something I don't see mentioned in this thread is that Autohotkey is more than just hotkeys. It can also create basic GUIs using native Windows widgets, and is probably the fastest way of producing a GUI on windows (the resulting script can be bundled into an .exe file)

Very much this. Years ago I wrote an AHK script to save the contents of the (image) clipboard to a file, and insert an Org mode link into my Emacs buffer. The GUI was simple: Just give me a dialog box so I can specify where to store the image. Once I do that, it provides the full path to my Emacs function.

I'm not an AHK expert. Very much a beginner. This was trivial.

Re: In Praise of AutoHotKey

#87

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…

> It was really quite depraved but it worked > but alas the overworked, underskilled, and somewhat frightened IT person couldn't stomach the risk this seems like a reasonable call to me.

Not at all.

He could have written his own program and just used it, and IT would never have gotten involved. Because it was using a 3rd party tool, IT got lazy.

My company, BTW, not only explicitly allows AHK, they actually encourage it. I mean, if you're going to give people compilers to write arbitrary code, this is not worse.

Re: In Praise of AutoHotKey

#88
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…

When I had a work-Mac I used Keyboard Maestro for stuff similar to this. It can do stuff based on a variety of input events; I had it do "location-y" stuff for me upon wake so it would do different things based on if it woke at the office or at my house, for example.

Re: In Praise of AutoHotKey

#89
post #87

Earlier quoted context omitted.

> It was really quite depraved but it worked > but alas the overworked, underskilled, and somewhat frightened IT person couldn't stomach the risk this seems like a reasonable call to me.

Not at all. He could have written his own program and just used it, and IT would never have gotten involved. Because it was using a 3rd party tool, IT got lazy. My company, BTW, not only explicitly allows AHK, they actually encourage it. I mean, if you're going to give people compilers to write arbitrary code, this is not worse.

It seems weird to expect someone with no programming training (an IT guy) to either build or sign off on something they have no understanding of. In large/high stakes settings, being risk averse and knowing the limits of your understanding are very good traits.

Imho, this IT guy did his job, more or less. What was the testing plan for this AHK script? What edge cases were considered? Unit tests, integ tests.... was there a preprod environment for it? A trial run? Can you safely roll back if / when bad data shows up? What's the retry strategy for network or up/downstream fault tolerance? Is there alarm or monitor coverage for bad scenarios?

I'm not saying a bunch of people typing are error prone, if that's your take on my post. I just think that there's a VERY different set of risks (and therefore mitigations) between a distributed manual process and a large scale automated one.

The IT guy might have on some level recognized this and judged the possible loss to be way more than the "guaranteed loss" of the not-broken current process.

If I were an IT guy with low level skills, I'd be proud of myself for making that hard call.

Re: In Praise of AutoHotKey

#90
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…

Thanks for sharing the dotfiles!

I use combination of BTT, Karabiner Elements, yabai and skhd to do remappings but this comment has intrigued me to give hammerspoon a shot!

Post reply on HN