← HomeSeries
Software Through the Ages
EPISODE 37 · 1982 → today

Keyboard and desktop automation: from SuperKey to AutoHotkey and Playwright

Some repetition lives outside any one program: typing the same phrases, pressing the same key sequence in an old application, filling the same web form, clicking through the same dialog every morning. Keyboard enhancers, desktop automation tools and browser robots handle this layer — from DOS memory-resident programs to AutoHotkey and the test tools that drive web browsers.

1985
Borland SuperKey: keyboard macros for DOS
1990
Windows 3.0 Recorder
1999
AutoIt
2003
AutoHotkey; v2.0 in 2022
2004
Selenium automates web browsers
2020
Microsoft Playwright

01The requirement: automate programs that were never meant to be automated

RequirementWhyWhat these tools offered
Type lessAddresses, signatures, standard remarks and part numbers are typed hundreds of timesKeyboard macros and text expansion
Add shortcuts to any programOld software has no macro languageGlobal hotkeys that send keystrokes and clicks
Glue several programs togetherCopy from one window, paste into another, save, repeatDesktop automation scripts
Test software repeatedlyEvery release needs the same screens checkedGUI and browser test automation
Fill web forms and fetch reportsPortals offer no download APIBrowser robots (with permission)

02History

1982–1985 — Keyboard enhancers for DOS. Memory-resident (TSR) programs such as RoseSoft's ProKey and Borland's SuperKey (1985) intercepted the keyboard: one key could type a paragraph or a long command sequence in any program. Used for WordStar, dBase and 1-2-3 work.
1990 — Windows Recorder. Windows 3.0 and 3.1 included Recorder, which played back mouse and keyboard actions. It was dropped in Windows 95, and third-party tools such as Macro Express filled the gap.
1997–2005 — Accessibility APIs. Microsoft Active Accessibility (1997) and UI Automation (2005) let screen readers — and automation tools — find buttons and text boxes by name rather than by screen position.
1999 — AutoIt. Jonathan Bennett wrote AutoIt to automate software installation on many PCs; AutoIt v3 (2004) became a full BASIC-like scripting language.
2003 — AutoHotkey. Chris Mallett created AutoHotkey, focused on hotkeys and "hotstrings" (text expansion). It became one of the most popular free Windows utilities; AutoHotkey v2.0, a cleaner language, was released in December 2022.
2000s — Text expanders. PhraseExpress, Breevy and others managed libraries of snippets; the open-source Espanso (2019) works on Windows, Linux and macOS with simple text configuration files.
2004–2018 — Selenium and WebDriver. Jason Huggins at ThoughtWorks wrote Selenium to test web applications; it merged with Simon Stewart's WebDriver in Selenium 2 (2011), and WebDriver became a W3C standard in 2018.
2009–2014 — Image-based automation. Sikuli (MIT, 2009) clicked on screenshots of buttons; PyAutoGUI (2014) gave Python simple mouse and keyboard control.
2017–2020 — Modern browser robots. Google's Puppeteer (2017) controlled Chrome directly; Microsoft's Playwright (2020) drives Chromium, Firefox and WebKit with automatic waiting, and became widely used for testing and automation.

03Try it: text expansion

Edit the abbreviations, then type in the box. An abbreviation followed by a space or Enter expands — the way AutoHotkey hotstrings and Espanso work. The matching configuration for each tool is written for you.

Abbreviations (one per line: abbreviation = text; {date} inserts today)
Type here (try ";etr " or ";dt ")

04Try it: why recorded clicks break

A recorded macro that clicks at screen position (x, y) works only if every window is exactly where it was. Tools that find controls through UI Automation (by name or ID) survive moved windows, different screens and larger fonts. Move the window and run both macros.

05Browser automation

ToolYearApproach
Selenium / WebDriver2004 / 2011Standard protocol to drive any browser; bindings for Java, Python, C#; W3C Recommendation 2018
iMacros2001Browser add-on that recorded web form filling; discontinued
Puppeteer2017Node.js library controlling Chrome through its DevTools protocol
Cypress2017Testing framework running inside the browser
Playwright2020Microsoft; Chromium, Firefox and WebKit; Python, JavaScript, Java, .NET; records scripts with playwright codegen
Automating someone else's website may break its terms of use and can overload the server. Use official downloads or APIs where they exist, keep a polite delay between requests, and never automate log-ins to systems you are not authorised to use.

06Ready-to-use scripts

A. Everyday hotkeys (AutoHotkey v2, my_hotkeys.ahk)

#Requires AutoHotkey v2.0
#SingleInstance Force

; Ctrl+Alt+D types today's date, e.g. 2026-11-15
^!d::SendText FormatTime(, "yyyy-MM-dd")

; Ctrl+Alt+V pastes clipboard as plain text (drops fonts and colours)
^!v::
{
    A_Clipboard := A_Clipboard     ; re-assigning keeps only the text
    Send "^v"
}

; Ctrl+Alt+N opens Notepad, or switches to it if already open
^!n::
{
    if WinExist("ahk_exe notepad.exe")
        WinActivate
    else
        Run "notepad.exe"
}

; Only in Excel: F9 saves the workbook and shows a tooltip
#HotIf WinActive("ahk_exe EXCEL.EXE")
F9::
{
    Send "^s"
    ToolTip "Saved"
    SetTimer () => ToolTip(), -1000
}
#HotIf

Save as UTF-8 text with the .ahk extension and double-click to run; put a shortcut in shell:startup to start it with Windows.

B. Snippets with a date (Espanso, match/base.yml)

matches:
  - trigger: ";etr"
    replace: "Endurance Test Rig"

  - trigger: ";dt"
    replace: "{{today}}"
    vars:
      - name: today
        type: date
        params:
          format: "%Y-%m-%d"

  - trigger: ";obs"
    replace: |
      Observation:
      Action taken:
      Status: Open

C. Open a web page, check it and save a screenshot (Python + Playwright)

# pip install playwright   then   playwright install chromium
from datetime import date
from playwright.sync_api import sync_playwright

URL = "https://www.example.com"          # e.g. your intranet status page

with sync_playwright() as p:
    browser = p.chromium.launch()        # headless; use launch(headless=False) to watch
    page = browser.new_page()
    page.goto(URL)
    print("Title:", page.title())
    page.screenshot(path=f"status_{date.today()}.png", full_page=True)
    browser.close()

D. Simple mouse and keyboard control (Python + PyAutoGUI)

# pip install pyautogui  — moving the mouse to a screen corner aborts (fail-safe)
import time
import pyautogui

pyautogui.PAUSE = 0.3          # pause after every action
time.sleep(3)                  # 3 s to click into the target window
for run in range(14, 19):
    pyautogui.write(f"Run {run}")
    pyautogui.press("tab")
    pyautogui.write("Checked")
    pyautogui.press("enter")

07Version explorer

Blue chips: keyboard and desktop tools. Amber chips: browser automation.

08Getting the tools safely

ToolOfficial sitewinget / pip
AutoHotkey v2autohotkey.comwinget install AutoHotkey.AutoHotkey
AutoItautoitscript.comInstaller from the site
Espansoespanso.orgwinget install Espanso.Espanso
PowerToys (Keyboard Manager)github.com/microsoft/PowerToyswinget install Microsoft.PowerToys
Playwright, PyAutoGUIplaywright.dev, pyautogui.readthedocs.iopip install playwright pyautogui

AutoHotkey and AutoIt scripts compiled to .exe are often flagged by antivirus because malware authors use them too; run scripts, not unknown compiled files. Many offices restrict these tools — check IT policy first.

09Lessons for engineers

  1. Automate at the highest level available. API or file first, browser automation second, screen clicks last.
  2. Find controls by name, not position. Coordinate macros break with every screen change.
  3. Add waits and checks. Programs are slower some days; a robot that types into the wrong window is worse than none.
  4. Text expansion is the safest win. Standard phrases, part numbers and remarks become consistent as well as faster.

Sources & further reading

  1. Wikipedia — AutoHotkey · AutoHotkey v2 documentation · AutoIt
  2. Espanso documentation
  3. Wikipedia — Selenium · W3C WebDriver · Playwright for Python
  4. Microsoft — UI Automation · PyAutoGUI