Skip to content

Tips & Tricks

My ahk scripts can be found in the config repo

Comment

;------------
;-- Comment
;--

Performance and Compatility

; Recommended for performance and compatibility with future AutoHotkey releases
#NoEnv

Warnings

; Enable warnings to assist with detecting common errors
#Warn

Enable Regex for Title mach Mode

SetTitleMatchMode,RegEx ; then
IfWinExist, Total Commander.*

Tray Icon and ToolTip

Menu, TRAY, Icon, Favicon.ico
Menu, TRAY, Tip, Tooltip Text

Examples

For Win10 Hibernate

; Wait for Hotkey
;   Ctrl + Win + Alt + l
; Send Hotkey
;   Ctrl + Win + x + u + s
^#<!l::Send #xuh

For Win10 Sleep

; Wait for Hotkey
;   Ctrl + Win + l
; Send Hotkey
;   Win + x + u + s
^#l::Send #xus

Home and End Hotkey

; Ctrl + Left
^Left::Send {Home}
; Ctrl + Right
^Right::Send {End}

Check for AHK Version and output message

If (A_AhkVersion < "1.0.39.00")
{
    MsgBox,20,,This script may not work properly with your version of AutoHotkey. Continue?
    IfMsgBox,No
    ExitApp
}

Supend a script via Hotkey

f1::suspend