01The requirement: automate programs that were never meant to be automated
| Requirement | Why | What these tools offered |
|---|---|---|
| Type less | Addresses, signatures, standard remarks and part numbers are typed hundreds of times | Keyboard macros and text expansion |
| Add shortcuts to any program | Old software has no macro language | Global hotkeys that send keystrokes and clicks |
| Glue several programs together | Copy from one window, paste into another, save, repeat | Desktop automation scripts |
| Test software repeatedly | Every release needs the same screens checked | GUI and browser test automation |
| Fill web forms and fetch reports | Portals offer no download API | Browser robots (with permission) |
02History
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.
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
| Tool | Year | Approach |
|---|---|---|
| Selenium / WebDriver | 2004 / 2011 | Standard protocol to drive any browser; bindings for Java, Python, C#; W3C Recommendation 2018 |
| iMacros | 2001 | Browser add-on that recorded web form filling; discontinued |
| Puppeteer | 2017 | Node.js library controlling Chrome through its DevTools protocol |
| Cypress | 2017 | Testing framework running inside the browser |
| Playwright | 2020 | Microsoft; Chromium, Firefox and WebKit; Python, JavaScript, Java, .NET; records scripts with playwright codegen |
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
}
#HotIfSave 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: OpenC. 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
| Tool | Official site | winget / pip |
|---|---|---|
| AutoHotkey v2 | autohotkey.com | winget install AutoHotkey.AutoHotkey |
| AutoIt | autoitscript.com | Installer from the site |
| Espanso | espanso.org | winget install Espanso.Espanso |
| PowerToys (Keyboard Manager) | github.com/microsoft/PowerToys | winget install Microsoft.PowerToys |
| Playwright, PyAutoGUI | playwright.dev, pyautogui.readthedocs.io | pip 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
- Automate at the highest level available. API or file first, browser automation second, screen clicks last.
- Find controls by name, not position. Coordinate macros break with every screen change.
- Add waits and checks. Programs are slower some days; a robot that types into the wrong window is worse than none.
- Text expansion is the safest win. Standard phrases, part numbers and remarks become consistent as well as faster.