AutoHotkey Lesson 2: Text Expansion (Hotstrings)

📎 This article includes 1 downloadable practice file ↓

⏱ 1 min read

📘 AutoHotkey Beginner Course · Lesson 2 of 6

In this article
  1. Basic hotstrings
  2. Options
  3. Multi-line and dynamic text
  4. Where people go wrong
  5. Practice

You type your email address, office address and the same replies many times a day. Hotstrings expand short codes into full text in any app.

Basic hotstrings

::@@::[email protected]
::addr::12, MG Road, Pune 411001

Type @@ then a space or Enter, and it becomes your email.

Options

Option Effect
:*: Expand immediately, no space needed
:C: Case-sensitive
:?: Expand even inside a word

Multi-line and dynamic text

::;sig::
(
Regards,
Ravi Kumar
)
:*:;dt::{
    SendText FormatTime(, "dd-MM-yyyy")
}
💡 Start codes with a character you never type normally, like ; or @@, so they don’t fire by accident inside real words.

Where people go wrong

Problem Fix
Expands inside normal words Use a ; prefix
Special characters typed wrongly Use SendText for literal text

Practice

Run the script, change the texts to yours and add five replies you type often.

📎 Practice files for this article

  • ⌨️
    Lesson 2 script (AutoHotkey v2)Double-click to run after installing AutoHotkey v2.
    ⬇ AHK · 310 B

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong