Live data from Hacker News

In Praise of AutoHotKey

hillelwayne.com

171–180 of 220 posts

Re: In Praise of AutoHotKey

#172

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…

Awesome. And gross. And awesome.

I did something similar around the same time parsing out some archaic TSV format. I forget the details of it all but we were copy-pasting from Notepad to Excel which I think involved changing some Notepad word wrap preference with every file? I think the objective was to get a CSV file and then FTP it somewhere?

Anyway, I wrote a powershell script I think it was, maybe I managed to install python? Whatever it was I basically replaced myself with a shell script and spent my spare time posting on somethingawful. Which actually did lead to a better job interview. Overall a good use of my time.

I hadn't thought about this for years. Thanks for reminding me, I think.

Re: In Praise of AutoHotKey

#173

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 t…

> copied the raw compiled machine code (as hex) into AutoHotkey and directly called it with DllCall

Holy potatoes, you can do that?! Or, I suppose, you could do that, because I half-expect you can't anymore with all the various security features that were added to Windows over the last two decades. But cool stuff nonetheless.

It reminds me of my own foray into the space of running assembly output; back in my teenage years, I compiled a small bit of assembly into an object file, read it into a C++ program, casted the string into a function pointer and executed. Surprisingly, it worked. I got the idea from StarCraft modding scene; in those days, if you wanted to add a new button for your unit that did something, you had to write the action in assembly, compile it with MASM, and then let StarGraft tool patch the game executable with it (I don't remember if it did it at runtime or modified the actual executable).

Re: In Praise of AutoHotKey

#174

Earlier quoted context omitted.

I'm a bit masochistic when it comes to typos. This is from my AHK script: :*:netowrk:: Send, {Home}+{End}{Delete} return What it does: I have a really bad habit of misspelling "network" that way. I think my right hand is just so eager to get that 'o' keyed in that it doesn't wait for my left hand to hit the 'w' first. So I'm always screwing that word up when typing quickly. So now, when I make that mistake, I'm punis…

You should add a popup that requires you to type in "network" correctly and then issues a Ctrl+Z.

> add a system-modal popup that requires you to type in "network" correctly 50 times in a row and then issues a Ctrl+Z; if you make a mistake, you start over.

There, fixed :).

Re: In Praise of AutoHotKey

#175
post #15

Here's what we really need - a tool that monitors the various user actions like specific application functionality used, website actions taken, and maybe keystrokes too (but that gets dicey), and then every month or so it recommends the most frequently done actions that you should automate with AHK or some other tool. What does the community think of this? PS - I use Alfred and Keyboard Maestro to get functionality s…

I've dreamed of making this.

Re: In Praise of AutoHotKey

#176
post #48

AHK solved a quirky issue my work had me develop. We have an excel sheet that gets updated periodically throughout the day by various people. When the spreadsheet is saved it also publishes an MHT file to be displayed on a webbrowser that refreshes every 5 minutes. That browser runs on a little Intel stick plugged into a wall-mounted TV to show the spreadsheet to various parts of the office / production floor. At nig…

Ooh, I'm guessing Windows and its weird treatment of powered-off monitors.

I dual-boot and leave my home PC on for weeks at a time; I just power the screens off when I stop working. My Linux system doesn't even notice; when I come back, everything is at it was. Windows however, the second it notices I powered off one screen, moves all the Windows to the other one. So the first thing I have to do when I come back is to rearrange the windows back to where they were.

I don't know the justification for this behavior of Windows.

Re: In Praise of AutoHotKey

#177
post #15

Here's what we really need - a tool that monitors the various user actions like specific application functionality used, website actions taken, and maybe keystrokes too (but that gets dicey), and then every month or so it recommends the most frequently done actions that you should automate with AHK or some other tool. What does the community think of this? PS - I use Alfred and Keyboard Maestro to get functionality s…

I might be misremembering, but I think there was a package for Emacs that would track the most frequently used M-x commands, so that you could later look at the list and see which ones are worth binding to a key. I can't for the love of me find it now.

Re: In Praise of AutoHotKey

#178

Earlier quoted context omitted.

You should add a popup that requires you to type in "network" correctly and then issues a Ctrl+Z.

> add a system-modal popup that requires you to type in "network" correctly 50 times in a row and then issues a Ctrl+Z; if you make a mistake, you start over. There, fixed :).

Working on it. And to make sure I don’t cheat, it’ll put me into a kiosk mode and temporarily change my password to prevent me from escaping my punishment.

It’ll be like my very own ransomware!

Re: In Praise of AutoHotKey

#179

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.

Perhaps. It certainly wouldn't have been me that had to live with it. It might have been hard to stop using it. To give some context this was a utility company. The gas pipes were consumer and commercial supply lines. You need to know where they are buried so people don't blow themselves up digging them up. It was safety critical. >> It was really quite depraved but it worked The baseline context for this, though, is…

If it really reduced the required time six fold, the obvious safety-productivity win-win would be to independently (ie different workers) enter everything twice. You would enjoy a three fold improvement in time requirements, should nearly eliminate all basic data entry errors, and significantly improve the employee experience. Or you could just decide to pass on all that, that's always an option I suppose.

Re: In Praise of AutoHotKey

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

Having used both Hammerspoon and AHK, the latter is somehow both terser and more ergonomic. I miss it dearly when I'm not on Windows. And I actually use caps lock as a "fn" key for hjkl/arrows. Who needs caps lock, really? I've actually gone kind of crazy with this idea and made my left ctrl, shift and alt behave as fn+ctrl, fn+shift and fn+alt, so that e.g. left ctrl+h actually does ctrl+left. Then I made fn+[ = pgu…

You can use Quick Actions (formerly Services) to trigger Mac automations, with customized Keyboard Shortcuts and text input replacements but it’s all scattered across a dozen apps and it’s kind of clunky to piece a workflow together from all these parts. But if you know the ins and outs, there’s a lot you can accomplish from a Mac, particularly as macOS has historically had better app support for AppleScript and somewhat better accessibility tooling. http://www.macosxautomation.com/automator/services/extension...

Recent attempts to lock down the system point to how it’s “not the default” to customize your Mac outside the App Store. And I find the share sheet is still more useful on iOS than on macOS (for now?) just as Finder is more useful on macOS than Files app is on iOS.

That said, Windows Terminal and WSL highlight that Microsoft isn’t slowing down here and Apple might actually need to play catch-up at some point and evaluate new approaches to developer and power user pain points. (AppleCare-supported upgradable storage is on my wish list but that’s not technically the software’s fault... just a policy Apple used to have and then later removed from their website as they moved to proprietary SSD controllers)

Post reply on HN