[ad_1]
Every second you spend at your screen performing mundane, redundant tasks adds up to hours of your life wasted on avoidable repetition. These AutoHotkey scripts will reclaim that time and transform how you interact with your PC.
1
Quickly Google Any Selected Text
If you’re new to AutoHotkey, it’s a powerful scripting language for automating repetitive tasks in Windows. With just a few lines of code, you can streamline everyday actions—like searching the web with a single keystroke.
This first script allows you to highlight any text, press Ctrl+Shift+S, and a new tab will magically open with Google results for your selection. No need to reach for your browser, type into the search bar, and hit Enter, this script does it all in one move.
#Requires AutoHotkey v2.0^+s:: {
Clipboard := ""
Send("^c")
ClipWait()
Run "https://www.google.com"
WinWaitActive "Google - Google Chrome" ; Adjust window title as needed
Sleep 500
Send("^v")
Sleep 100
Send("{Enter}")
}
Perfect for quick research, verifying a term, or pulling up references without losing momentum. It’s like having a research assistant living in your clipboard.
2
Kill Any Frozen App Without Task Manager
When an app locks up or refuses to die, Ctrl+Alt+K cuts it off with no extra steps involved. It closes the currently active window, no questions asked. That means you can get back to what matters in mere seconds.
#Requires AutoHotkey v2.0^!k:: {
pid := WinGetPID("A")
if (pid) {
procName := ""
for proc in ComObjGet("winmgmts:").ExecQuery("SELECT Name, ProcessId FROM Win32_Process WHERE ProcessId = " pid) {
procName := proc.Name
}
if (procName != "explorer.exe") {
Run('taskkill /PID ' . pid . ' /F', "", "Hide")
} else {
MsgBox("Cannot kill explorer.exe! Killing this will crash your taskbar.")
}
}
}
This script has saved me from frozen screens, looping video players, and even Photoshop when it throws its biweekly temperamental fit. Keep in mind there are also some hidden Windows tricks to instantly close apps, which could be worth exploring.
3
Instantly Mute System Volume
Every keyboard seems to have a different key combination for muting your audio. Downloading this script onto each of your rigs creates a universal solution to a universally annoying problem.
#Requires AutoHotkey v2.0^!m:: ; Ctrl+Alt+M to toggle mute
{
Send("{Volume_Mute}")
}
Whether someone calls unexpectedly or you open a loud website in the middle of a quiet room, this shortcut gives you instantaneous control. Ctrl+Alt+M toggles your system mute on or off. No fumbling with your keyboard’s media keys, no distractions, just silence when you need it most.
4
Remap Caps Lock to Ctrl (Without Losing Caps Lock)
If you’re constantly using Ctrl shortcuts like copy, paste, undo, select all, your pinky will thank you for this one. This script makes the Caps Lock key behave like Ctrl, which is far more ergonomic, especially if you’re on the left side of the keyboard all day.
#Requires AutoHotkey v2.0SetCapsLockState("AlwaysOff")
CapsLock:: {
Send("{Ctrl down}")
KeyWait("CapsLock")
Send("{Ctrl up}")
}+CapsLock:: SetCapsLockState("Toggle")
Don’t worry, you’re not losing Caps Lock. This script reassigns enabling/disabling Caps Lock to Ctrl+Caps, if you end up needing it for any reason. But for everyday use? This makes Ctrl keying faster and more comfortable than ever.
This script can also apply to any inconveniently placed button on your keyboard. Simply swap out the keys in the script itself and replace them with any other hard-to-reach key.
5
Launch Your Most-Used App with One Key Combo
If you’ve been ignoring Notepad, it’s time to take a second look. Whether you’re jotting down ideas, writing temporary code, or dumping text before you lose it, Notepad is the go-to for speed and simplicity.
#Requires AutoHotkey v2.0^!n:: Run("notepad.exe")
With this, Ctrl+Alt+N launches Notepad right away. You can swap in any app: Calculator, Word, Outlook, whatever you choose. It allows you to save time by cutting out the Start menu and search bar completely.
6
Open Your Favorite Folders
One keystroke is all it takes to open your Documents folder, or literally any folder you rely on. Whether it’s your project repo, downloads dump, or a client archive, you don’t need to click around like it’s 2009.
#Requires AutoHotkey v2.0userProfile := EnvGet("USERPROFILE")
^!d:: Run(userProfile "\Documents")
^!p:: Run(userProfile "\Pictures")
^!v:: Run(userProfile "\Videos")
I’ve mapped Ctrl+Alt+D to Documents, Ctrl+Alt+P to Pictures, and Ctrl+Alt+V to my Videos folder. The muscle memory is basic, so you hardly have to think about what you’re doing.
7
Toggle Hidden Files in File Explorer
There are plenty of ways to hide your files or folders in Windows, but what about making them easily visible again. This script toggles hidden files visibility without diving into File Explorer settings or clicking four menus deep. It even restarts Explorer automatically to apply the change.
#Requires AutoHotkey v2.0^!h:: {
toggleHiddenFiles()
}toggleHiddenFiles() {
psCmd := "
(
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
$val = Get-ItemProperty -Path $key -Name Hidden
if ($val.Hidden -eq 1) {
Set-ItemProperty -Path $key -Name Hidden -Value 2
} else {
Set-ItemProperty -Path $key -Name Hidden -Value 1
}
(New-Object -ComObject Shell.Application).Windows() | ForEach-Object { $_.Refresh() }
)"RunWait("powershell -Command " . Chr(34) . psCmd . Chr(34), "", "Hide")
}
Ctrl+Alt+H. That’s it. You can see .git, .env, and every other sneaky file instantly. Essential for developers, system admins, and anyone who works under the hood.
8
Instantly Paste Your Email Address
This one is so simple—and yet so incredibly useful—that it almost feels like cheating. Anytime you’re filling out a form, logging into a new device, or registering to an unknown service, typing “@@” instantly pastes your email address.
#Requires AutoHotkey v2.0::@@::your.email@example.com
You can set up your own variations too, such as “@@w” for work, or “@@p” for personal. It’s a tiny shortcut, but it adds up fast. One less thing you’ll have to type up fifty times a week.
9
Paste an Email Template or Quick Text Snippet
I use this for email sign-offs, bug report templates, even pre-written onboarding responses. You can insert line breaks using {Enter} and format it however you want.
#Requires AutoHotkey v2.0::sig::Best regards,{Enter}Your Name{Enter}your.email@example.com
Once you start automating these micro-interactions, you realize how often you repeat yourself. Cut that out of your day and you’ll feel the difference.
10
Date & Time Stamp Wherever You Type
Ever type a meeting note, journal entry, or changelog and stop to check the time? This script makes that obsolete. Type “ts” and a full date/time stamp appears, formatted just the way I like it.
#Requires AutoHotkey v2.0::ts::
{
; Get the current time components
hour12 := A_Hour
ampm := "am"if (hour12 = 0) {
hour12 := 12
ampm := "am"
} else if (hour12 >= 12) {
if (hour12 > 12)
hour12 -= 12
ampm := "pm"
}FormatTime := Format("{:02}/{:02}/{} {:d}:{:02}{}", A_MM, A_DD, A_YYYY, hour12, A_Min, ampm)
Send(FormatTime)
Return
}
One major benefit of this simple script is that timestamps enhance data security in digital systems. You have the option to tweak the date format to DD/MM/YYY or change the clock to 24-hour time, if that’s useful for your line of work. It’s fast, silent, and perfect for those who document as they go.
[ad_2]
Source link













