1
votes

67-year-old grannie here. My 12-year-old programmable keyboard died and I will try to use AutoHotkey in its stead to do simple keyboard macros. Here's the first one I need to create. When I press F12, I want it to send these keystrokes to Audacity (but it could be any program; the keystrokes are simply shortcut keys to do specific functions): Alt+G S Enter Enter

How would I program that in AutoHotkey?

1

1 Answers

0
votes

Fairly straightforward:

F12:: ;When F12 is pressed
Send !g ;Press Alt+g
Send s ;Press s
Send {Enter 2} ;Press Enter Twice
return ;End this hotkey

(Note: Anything after a semicolon is a comment)

When tested in Audacity, it properly generates a default length clip of silence, then deselects the created audio segment.


Bonus:

Add #IfWinActive ahk_exe audacity.exe to the top of the script to make the hotkey only activate if Audacity is the active window.