Desktop / Technology · 2024-03-09

AutoHotKey Tips

I am in love with AutoHotKey, in a “man to computer application” sort of way. I use it all the time, perhaps several times per hour while I am on my computer, which is a majority of a typical day.

What is AutoHotKey? It’s a customizable Hot Key automation scripting application, I guess you might say.

Let’s say I want to type the date. Well, all I need to do it press the CTRL key and the ; key together, and voila! It spits out: 2024-03-09.

What about date and time?  I just press ALT and ; and it spits out: 2024-03-09 AM0746. (Why have “AM” before the time? Check here: https://benjf.com/2023/05/date-formatting-unites-the-world/ .)

If I type yw followed by a space or period or exclamation point or enter, it converts it to you're welcome plus whatever punctuation or next keystroke I used after it. This saves a ton of effort at work when people always end a conversation with “thanks!”. I just type yw and press enter and it converts it for me.

How about emojis? I type :) and it changes it to 😊. The list goes on and on.

So, if you use AutoHotKey, here are some of my shortcuts that you can implement:

Automatically Reload AutoHotKey

This is useful after you make a change to your AutoHotKey script. Rather than moving the mouse to the taskbar, hovering over the AutoHotKey icon, right clicking, and selecting “Reload This Script”, just press CTRL + ALT + r.

;----====----====----====----====----====----====----====----====
; Reload this script with Ctrl+Alt+R
;----====----====----====----====----====----====----====----====
^!r::Reload

Replace XD with 😆

;----====----====----====----====----====----====----====----====
;   REPLACE XD with laugh face
; (Smiling Face With Open Mouth And Tightly-Closed Eyes)
;----====----====----====----====----====----====----====----====*/
::XD::
SendInput {U+1F606}
return

Replace :) with 😊

;----====----====----====----====----====----====----====----====
;   REPLACE :) with smiley face
;----====----====----====----====----====----====----====----====*/
:::)::
SendInput {U+1F60A}
return

Replace :| with 😐

;----====----====----====----====----====----====----====----====
;   REPLACE :| with straight face
;----====----====----====----====----====----====----====----====*/
:::|::
SendInput {U+1F610}
return

Date Only

;----====----====----====----====----====----====----====
; Date Only
; Ctrl+;
;----====----====----====----====----====----====----====
^;::
FormatTime, TimeString, R, yyyy-MM-dd
space := " "
SendInput, %TimeString%%space%
return

Date Time Stamp

;----====----====----====----====----====----====----====
; DTS - No Spaces, No Symbols
; ALT + ;
;----====----====----====----====----====----====----====
!;::
;FormatTime, TimeString, R, yyyyMMddHHmmss
FormatTime, TimeString, R, yyyy-MM-dd tthhmm

space := " "
linebreak := "`+`r"
SendInput, %TimeString%%space%
return

Time Only

;----====----====----====----====----====----====----====
; Time Only
; Ctrl + Shift + ;
;----====----====----====----====----====----====----====
^+;::
FormatTime, TimeString, R, tt:hh:mm:ss
space := " "
SendInput, %TimeString%%space%
return

Media Controls


;----====----====----====----====----====----====----====
; Volume Up
; Alt + = OR Alt + plus on number pad
;----====----====----====----====----====----====----====
!=::
!NumpadAdd::
;SoundSet, +1
SendInput {Volume_Up 1}
return

;----====----====----====----====----====----====----====
; Volume Down
; Alt + - OR Alt + minus on number pad
;----====----====----====----====----====----====----====
!-::
!NumpadSub::
;SoundSet, -1
SendInput {Volume_Down 1}
return

;----====----====----====----====----====----====----====
; Volume MUTE
; Alt + m
;----====----====----====----====----====----====----====
!m::
!NumpadMult::
SendInput {Volume_Mute}  ;
return

;----====----====----====----====----====----====----====
; Media Play Pause
; Alt + p
;----====----====----====----====----====----====----====
!p::
!NumpadDiv::
SendInput {Media_Play_Pause}  ;
return

;----====----====----====----====----====----====----====
; Media Play Next
; Alt + .
;----====----====----====----====----====----====----====
!.::
SendInput {Media_Next}  ;
return

;----====----====----====----====----====----====----====
; Media Play Next
; Alt + ,
;----====----====----====----====----====----====----====
!,::
SendInput {Media_Prev}  ;
return

Abbreviations Expanded

;----====----====----====----====----====----====----====
;abbreviations
;----====----====----====----====----====----====----====
::::atm::at the moment
::btw::by the way
::rn::right now
::wo::waiting on
::FU::follow up
::idk::I don't know
::imo::in my opinion
::prob::probably
::ty::thank you
::yw::you're welcome

Also, you can get a massive list of auto-correct words here: https://www.autohotkey.com/download/AutoCorrect.ahk