An AutoHotkey Tale

I recently received the following e-mail from Will Guest. Sharing it might inspire others to take a closer look at AutoHotkey. While Will implemented a serious solution to an expensive problem, you don’t need to work at his level to get tremendous benefit from AutoHotkey. Its simplicity makes it the choice for dealing with many Windows headaches—even for experienced programmers:

Hi, Jack,

I actually have another recent use for AHK, the technique(s) of which I’d gotten from one of your very helpful books. It’s a bit of a long story, but:

I’ve recently come back from almost two years in the Middle East (Abu Dhabi), where I was designing/ engineering/ installing/ and commissioning the AVCN (Audio Video Control Network) systems for a theme park project (Warner Bros. World, the ‘largest interior theme park on Earth’). We had a vendor installing a parkwide control and management system (Virtual Machines with a fault-tolerant Hypervisor) which was deployed on a per-node license basis. All good, but at least 18 of the nodes were all-in-one 7″ touch-panel PCs, which were used to turn On/ Off/ Set levels for the background music and lighting in the Food, Beverage, and Retail venues throughout the park. These touch panels were used about twenty minutes a day — if that much; so having a full license used for these rarely-used nodes was not the best (or fairest) plan. Plus, with the number of users that wanted to monitor the parkwide system, we were being put into a situation of having to buy additional (rarely used) licenses for a fairly large amount of money.

The SW vendor agreed that it wasn’t at all fair, but they wouldn’t be able to reprogram their licensing scheme for many months, and they suggested that we ‘turn off the unused interfaces’… which would not be workable for the client —- they wanted these control GUIs available within seconds, not minutes. ‘On and Off’ just wasn’t a viable solution.

I confirmed with the SW vendor that it would be okay if I had ‘my programming team’ work out something that could start and stop their licensing process on each host as needed, and the SW vendor agreed, though they didn’t think that it would work very well. They also sent a proposal for doing that work, which, even if it was faster and less expensive than their originally proposed license server system rewrite, it was still many weeks and many thousands of dollars away.

windowstoolscartoonSo, I used that ‘secret weapon’, AutoHotKey — I used AHK to timeout that control GUI after the touch-panel was used, bring up a graphic that made it look as if the interface was still there, and, if the touch-panel was triggered again, re-launch the ‘real’ control GUI for the client to use. AHK would timeout the control GUI again after a bit, and the whole process would start over again. Since the licenses were counted by the number of actual simultaneous ‘active’ interfaces, we went from those 18-24 always-on licenses to an average of two (!) licenses active at any one time. We didn’t need to wait, didn’t inconvenience our client, and didn’t spend $50K on additional licenses that we didn’t need. The other licenses for the major and minor attractions remained always-on, and always in use — they were not affected by my use of AHK in any way.

It took me twenty to thirty minutes to write, an hour to test (I had to pull a spare unit from storage), and about ten minutes to deploy to the affected nodes; the activity ‘fix’ went live that day. The client was able to use the current licenses to completely ‘roam’ and support all the venues in the entire system without losing any usability. The SW vendor noticed the increase in available licenses over the next few days, and they asked how the client was dealing with all those items being turned off. I mentioned that ‘my programming team’ had ‘worked something out’, and that nothing had to be turned off. The SW vendor was startled but complimented the ‘mad skillz’ of my 14-person on-site programming team. I thanked them for complimenting my team (who were pulling double-shifts to get this billion-dollar project open on time), and I was able to go back to work. I didn’t tell them how it was done — some secrets are worth keeping.

AHK saved us, getting my company and the client out of an unanticipated and potentially very tight spot.

Months later, the client moved to a site license for the control GUI interfaces, which was a good idea, as the control GUIs were going to be expanded to other facilities owned by the client. With this change, we no longer needed the AHK ‘workaround’. However, the AHK solution worked flawlessly for almost six months under 24/7 use, and I was able to solve a problem in literally minutes.

Yes, this could’ve been done in Python, or .Net, or probably C++ (all possibilities, if I’d had any time available from my team), but it was almost faster for me to do it in AHK than it would’ve been for me to type the pseudocode notes to be used for any of those languages.

So, a long story that basically comes down to a sincere thank you, Jack. Your books and Blog helped my AHK fix problems on a bunch of projects, and they were fun to read and try, too. It just doesn’t get much better than that!


Will Guest

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s