Quick-Note using AutoHotkey 2.0
This is a minimalist scratchpad designed to fix the inherent lack of support for custom, global text entry in the native Windows environment. It’s a borderless terminal GUI with a focus on zero-cloud persistence—caching your work locally to survive reboots and dumping timestamped notes to your drive on command.
I’ve integrated a telemetry HUD that remains hidden until you hit a specific threshold to keep cognitive load to a minimum. It’s functional, direct, and utilizes low-level Win32 calls to keep the interaction snappy.
#Requires AutoHotkey v2.0
#SingleInstance Force
; --- Configuration ---
SaveDir := A_MyDocuments "\Scratchpad_Notes"
CacheFile := A_Temp "\scratchpad_cache.txt"
if !DirExist(SaveDir)
DirCreate(SaveDir)
Color_Bg := "1A1A1A"
Color_Text := "00FF00"
Color_Accent := "D70A53"
Global GW := 200
Global GH := 350
; --- GUI Definition ---
MyGui := Gui("+AlwaysOnTop -Caption +ToolWindow", "Scratchpad")
MyGui.BackColor := Color_Accent
MyGui.SetFont("s10 c" Color_Text, "Consolas")
; Edit-box
EditBox := MyGui.Add("Edit", "x1 y1 w" (GW-2) " h" (GH-2) " -VScroll -E0x200 Background" Color_Bg, "")
if FileExist(CacheFile)
EditBox.Value := FileRead(CacheFile)
EditBox.OnEvent("Change", (*) => UpdateCounter())
; --- Telemetry HUD ---
CountGui := Gui("-Caption +ToolWindow +AlwaysOnTop", "ScratchCount")
CountGui.BackColor := Color_Accent
CountGui.SetFont("s9 cWhite", "Consolas")
CharText := CountGui.Add("Text", "x3 y3 w75 Center", "0 ### 0")
WinSetTransparent(85, CountGui.Hwnd)
; --- Logic ---
UpdateCounter() {
Text := EditBox.Value
CharCount := StrLen(Text)
RegExReplace(Text, "\n", "`n", &LineCount)
LineCount += 1
CharText.Value := CharCount " ### " LineCount
if (CharCount > 2000 || LineCount > 25) {
MyGui.GetPos(&X, &Y, &W, &H)
CountGui.Show("x" (X + W + 10) " y" Y " w80 h22 NoActivate")
} else {
CountGui.Hide()
}
}
; --- Global Toggle (Win+I) ---
#I:: {
TargetX := (A_ScreenWidth * 0.70) - (GW / 2)
TargetY := (A_ScreenHeight / 2) - (GH / 2)
MyGui.Show("x" TargetX " y" TargetY " w" GW " h" GH)
EditBox.Focus()
SendMessage(0x00B1, -1, -1, EditBox.Hwnd)
UpdateCounter()
}
; --- Contextual Hotkeys ---
#HotIf WinActive("ahk_id " MyGui.Hwnd)
; Macros
^W:: {
targetX := 1359
targetY := 481
Click(targetX, targetY)
Sleep(50)
Send("^v")
}
^H:: {
EditBox.Focus()
Sleep(50)
HelpText := "--[ Manual ]--`nClear: Ctrl+N`nNew Document`n`nClose: Ctrl+C`nClose the window`nSave: Ctrl+S`nSave timestamped file`n`nPaste Copied text: Ctrl+W`n`nOpen New ControlPanel: Ctrl+Shift+V`n"
EditBox.Value := EditBox.Value . "`n" . HelpText
SendMessage(0x0115, 7, 0, EditBox.Hwnd) ; Scroll to bottom
}
; Scroll on line feed
~Enter:: SendMessage(0x0115, 7, 0, EditBox.Hwnd)
^s:: {
FilePath := SaveDir "\Note_" FormatTime(, "yyyy-MM-dd_HH-mm-ss") ".txt"
FileAppend(EditBox.Value, FilePath)
ToolTip("Saved")
SetTimer(() => ToolTip(), -1000)
}
^o:: Run(SaveDir)
^n:: (EditBox.Value := "", UpdateCounter())
^q::
^c::
Esc:: {
FileOpen(CacheFile, "w").Write(EditBox.Value)
MyGui.Hide()
CountGui.Hide()
}
#HotIf
What does it do?
It’s a functional proof of concept. I’ve always found it inconvenient how little support the Windows environment offers for custom functions and global keyboard shortcuts.
Before discovering how diverse and effective AHK coding could be, I was either compiling custom programs or creating shortcuts for keyboard command functions—neither of which was particularly efficient or easy to expand.
The eighth deadly sin of vibe coding
Don't judge "vibe coding," nor the support and intellectual fodder you can potentially gain if you use it correctly. While working on a minor function, I used Gemini and discovered a suggestion with complete code for AutoHotkey. At first, I was frustrated since the suggestion was unprompted, but then I actually tried it.
If you're a coder with a lot of integrity, this might sound like heresy. However, I’d argue that I get a lot of creative work done, have positive experiences, and learn new things—frequently more than I did previously. It is as valid a source for assistance with large amounts of code as it is for vibe coding.
As a programmer, you can't claim it's taking work from anyone. As a coder, I maintain a decent understanding and a healthy amount of cynicism while utilizing AI/LLM generated data.
Enjoy the quick note code; try it out. I've added a personal touch to the look and feel, not unlike the rest of this site. Later! :)