Autohotkey程序的简单宏可以通过以下代码实现:
#IfWinActive ahk_exe notepad.exe ; 激活notepad.exe时 $^1::Send, I am typing a script. ; 按下ctrl + 1键时发送文本"I am typing a script." #IfWinActive ; 取消激活
此代码在激活notepad.exe时,让用户按下组合键ctrl + 1发送文本"I am typing a script."。用户可以在程序中添加更多的宏来自动化其日常工作。