☕ Buy a Coffee
Home / Productivity & Coding

How to Use 'AutoHotkey' to Automate Repetitive Typing

Create global Windows hotstrings that expand email templates, current timestamps, and boilerplate snippets instantly as you type.

Sachin Siju
Sachin Siju
Lead Systems Engineer & Tech Blogger
Jul 10, 2026 4 min read
How to Use 'AutoHotkey' to Automate Repetitive Typing

Let Windows Type For You

If you type the same email sign-off, support template, or timestamp format dozens of times a day, you are wasting keystrokes on something a script can do instantly. AutoHotkey is a free, open-source Windows scripting tool built specifically for this — it can expand short abbreviations into full text anywhere you type, system-wide, without needing to be inside any particular application.

Installing AutoHotkey

Download the installer from autohotkey.com. Choose the current v2 release unless you specifically need to run legacy v1 scripts — this guide uses v2 syntax, which is the actively maintained version going forward. Run the installer and accept the defaults.

Creating Your First Script

Right-click anywhere on your desktop or in a folder, choose New, then AutoHotkey Script. Rename the file to something like hotstrings.ahk. Right-click it and choose Edit Script (or open it in any text editor).

Writing a Basic Hotstring

A "hotstring" is AutoHotkey's term for a text trigger that expands automatically as you type it. Add this line to your script:

::sig::Best regards,`nSachin Siju`nSystems Engineer

The double colons mark both ends of the trigger text (sig), and everything after the second :: is what gets typed in its place. `n is AutoHotkey's newline escape sequence. Save the file, then double-click it to run the script — you will see a green "H" icon appear in your system tray, confirming it is active.

Now open Notepad, or any text field anywhere in Windows, type sig, and press Space or Enter — AutoHotkey deletes what you typed and replaces it with the full expansion instantly.

Auto-Ending Characters and Preventing Accidental Triggers

By default, a hotstring fires when you type it followed by a non-alphanumeric character (space, punctuation, Enter). This means a short abbreviation like sig could accidentally trigger inside a longer word. Two useful modifiers placed before the first :: fix common issues:

:*:btw::by the way
:B0:addr::123 Main Street, Springfield
  • * fires the expansion immediately with no ending character needed — useful for short, unambiguous triggers
  • B0 disables AutoHotkey's automatic backspacing, useful when you want the trigger text to remain and the expansion appended after it instead of replacing it

Inserting a Live Timestamp

Static text is the simplest case, but hotstrings can also run a function that generates dynamic content. Use a hotstring paired with a Send command inside a function for anything that needs to change each time:

::ts::
{
    Send FormatTime(, "yyyy-MM-dd HH:mm")
}

Typing ts now inserts the current date and time, formatted like 2026-08-18 14:32, recalculated fresh every time you trigger it.

Building a Library of Boilerplate Snippets

A realistic support or IT ticketing hotstring file might look like this:

::brb::Be right back, stepping away for a moment.
::eta::I'll have an update for you within the hour.
::pwreset::Your password has been reset. Check your email for a temporary password valid for 24 hours.
:*:@@::sachin.siju@xube.me

Keep every hotstring in one .ahk file so they are easy to back up, version, and edit as a set rather than scattered across multiple scripts.

Running Your Script Automatically at Startup

For hotstrings to work, the script needs to be running — and you do not want to remember to double-click it every time you log in. Press Win+R, type shell:startup, and press Enter. This opens your Startup folder. Create a shortcut to your .ahk script inside that folder, and Windows will launch it automatically every time you sign in.

Reloading After Edits

Whenever you edit the script file while it is already running, right-click the green "H" tray icon and choose Reload Script to apply your changes without restarting Windows or re-launching manually.

Warning: Avoid extremely short, common trigger strings like the or and without the * or case-sensitivity modifiers — they will fire in the middle of normal words you did not intend to trigger. Test any new hotstring in a scratch Notepad window before relying on it in real documents or emails.

Beyond Hotstrings

AutoHotkey can do far more than text expansion — remapping keys, launching applications with a hotkey, automating mouse clicks, and scripting entire multi-step workflows. But hotstrings alone, for something as simple as an email signature or a timestamp, typically save more daily time than any of the more advanced features, precisely because they run silently in the background and need zero conscious effort once set up.

Featured Infrastructure Partner

Deploy on High-Performance Hostinger Cloud

Get up to 75% OFF + free domain & SSL. Powering xube.me's sub-second response times.

Claim Discount ↗

Discussion & Insights

Related Technical Essays