Skip to content

AutoHotKey#

Resources#

Scripts & Snippets#

SendMode#

It's usually good to add this line to the top of any AHK script, but it's not always the ideal option. See the AHK docs for more information.

Autohotkey
SendMode Input

Common Replacements#

Here are some common replacements you might be interested in using. >! denotes Right Alt.

Autohotkey
1
2
3
4
5
>!t::Send 
>!e::Send é
>!c::Send ¢
>!m::Send µ
>!.::Send 

Version#

This will tell you what version of AHK is running.

Autohotkey
Msgbox % "v" A_AhkVersion " " (A_PtrSize = 4 ? 32 : 64) "-bit " (A_IsUnicode ? "Unicode" : "ANSI")

Always on Top#

This allows you to toggle whether a window is always on top of other windows or not. The keybinding set here is Left Ctrl+Space.

Autohotkey
<^Space:: WinSet, AlwaysOnTop, Toggle, A

Toggle Hidden#

This toggles whether hidden items are hidden or not in File Explorer. The keybinding set here is Win+H.

Autohotkey
; WINDOWS KEY + H TOGGLES HIDDEN FILES 
#h:: 
RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden 
If HiddenFiles_Status = 2  
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1 
Else  
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2 
WinGetClass, eh_Class,A 
If (eh_Class = "#32770" OR A_OSVersion = "WIN_VISTA") 
send, {F5} 
Else PostMessage, 0x111, 28931,,, A 
Return

Tray Icons#

If you have many AHK scripts and don't want them all having the same green H tray icon, you can add a line like this to set it to something else.

Autohotkey
Menu, Tray, Icon, shell32.dll, 75