Text macros with autohotkey on windows
Bored of typing your name / address / email / Just plain ‘thank you’ over and over. Read on.
Quick Instructions
- Install Autohotkey
- Open notepad > paste the code shown below > save as
something.ahk
. Make sure its notsomething.ahk.txt
- Right click the something.ahk file > Run as admin. Observe the ‘H’ icon in your notification area
Done !
Usage / Test
- Open notepad
- Type: Ctrl+9
- Type ‘t’ -> ‘Thank you’ should be typed automatically
- Type ‘d’ -> Tomorrow’s date should be typed
Code
#Persistent
#InstallKeybdHook
DetectHiddenWindows, ON
SetKeyDelay, 1
^9::
Input Key, L1
if Key = w
Send wtf
else if Key = t
Send Thank you
else if Key = d
{
Tomorrow = %a_now%
Tomorrow += 1, Days
FormatTime, Tomorrow1, %Tomorrow%, yyyy-MM-dd
Send Tomorrow %Tomorrow1%
}
Configuring
The code should be self explanatory. But all you need to do is add more else if
blocks at the end.
Example:
else if Key = e
Send nik.jain@gmail.com
else if Key = n
Send Nikhil Jain
The End
I hope that was helpful.
June 2024