Home » How To » 17 Best and Most Useful AutoHotKey Scripts To Use On Daily Basis

17 Best and Most Useful AutoHotKey Scripts To Use On Daily Basis

Over the years, I’ve collected a lot of AutoHotKey scripts that make things easier. Here are some of the best and most useful AutoHotKey scripts.

I’ve said it multiple times and I will say it again, AutoHotKey is one of my favorite software. I use it daily for various things like keyboard shortcuts, key blocking, auto-correct, automation, etc. For instance, I accidentally press the CapsLock key all the time. To avoid that, I have a simple one-line AutoHotKey code to disable the CapsLock key. The same is true for other keys like NumLock and ScrollLock. Besides that, I also use AutoHotKey scripts in DOS & PS Emulators, to open applications, create custom keyboard shortcuts, macros, etc. Simply put, AutoHotKey is a very handy software that makes your life a little bit easier.

One of the best things about AutoHotKey is its community and the scripts they share. There are a ton of AutoHotKey scripts that can do a ton of things in a variety of ways. However, finding general-purpose AutoHotKey scripts to use on a daily basis is a bit harder. This is especially true for beginners who are not yet comfortable with AutoHotKey scripting.

So, to deal with that below is a list of best AutoHotKey scripts that I use quite often. Hopefully, they will help you too.

Best-autohotkey-scripts-autohotkey-key-style-logo

List of Best AutoHotKey Scripts

Before proceeding, I assume you’ve already installed AutoHotKey. If not, download and install it from the official website.

To create an AutoHotKey script file, create a regular text file and then replace the “.txt” extension with “.ahk”. You can then open that “.ahk” file with any text editor and copy and paste the below AutoHotKey scripts into it. You can place multiple AutoHotKey scripts in a single file as long as there is no conflict between key combinations. On the other hand, you can also create multiple script files and run them at the same time. For example, I have separate script files for keyboard shortcuts, autocorrect, and macros.

Also, keep in mind that you can always change the key bindings to meet your preferences. If you are ever in doubt or don’t know how to read the script, I recommend you take a quick look at the beginner-friendly AutoHotKey tutorial on the official website. That page lists all the simple things you can do in an easy-to-understand manner.

1. Toggle Hidden Files

Rather than selecting the “Hidden Items” checkbox or going to the Folder Options window, you can assign a dedicated AutoHotKey keyboard shortcut to quickly show or hide hidden files. Use the code below to toggle hidden files using AutoHotKey.

;Keyboard Shortcut - Win + H
 h::
{ 
 HiddenFiles_Status := RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden")
 if (HiddenFiles_Status = 2)
 RegWrite(1, "REG_DWORD", "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden")
 Else
 RegWrite(2, "REG_DWORD", "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden")
 Send("{F5}")
 return
}

2. Launch Applications

AutoHotkey can launch almost any application you want with a single keyboard shortcut. All you have to do is assign a keyboard shortcut and point it toward the application you want to launch. In the below script, replace the dummy path with the actual program path.

Note: You cannot launch Microsoft Store apps unless you know the actual app URI. This is because there is no exe file. You can generally find the URI on the developer’s website.

; Launch application
 #^P:: Run('"C:\Program Files\My\Program.exe"')
 return

3. Disable CapsLock

If you don’t like accidentally pressing the CapsLock key frequently, you can use the below script. It will disable the CapsLock key. Even if you press the key, nothing happens as long as the script is running.

;Disable caps lock
SetCapsLockState("AlwaysOff")
return

4. Always Keep NumLock Turned On

NumPad is one of the most useful parts of the full-length keyboard. This is especially true if you work with numbers. Though the NumPad is enabled by default in Windows, it is quite easy to turn it off. In addition to that, it can also be quite frustrating if Windows or some other application is messing with the Num Lock toggle. 

In those cases, use the below script to make sure that the NumPad lock is always turned on. Just like with CapsLock, even when you press the NumLock key, the key state won’t change, i.e. it won’t disable the NumPad.

; NumLock always enabled
SetNumlockState("AlwaysOn")
return

5. Give Function Keys a New Life

More often than not, the function keys on top of your keyboard are almost useless. Other than F2 and F5, the keys have nothing to do. So, why not repurpose them to do something useful? For example, I use the function keys to launch my most used applications.

In the below script, just replace “F3” with the function key of your choice and change the command to match your needs.

;Repurpose function keys
F4::Run "C:\Program Files\Open\Program.exe"
return

6. Remap Keys

In case of damaged or unused keys, you can remap them to act like any other key. For example, you can make the CapsLock key act like Shift. In the below script, replace “CapsLock” with the key you want to press and “Shift” with the target key you want it to act like.

;Remap Keys
 Capslock::Shift
 return

7. Change Volume

The keyboard media controls allow you to quickly change or mute the volume as and when needed without having to deal with the mouse. However, not all keyboards have volume control keys. In those situations, use the below AutoHotKey script to change the volume in Windows.

;Change volume
 ^NumpadAdd:: Send("{Volume_Up}") ;Ctrl + NumPad Plus
 ^NumpadSub:: Send("{Volume_Down}") ;Shift + NumPad Minus
 break:: Send("{Volume_Mute}") ; Break key (mute)
 return

8. Launch Websites

Along with applications, you can also use the AutoHotKey bindings to launch your favorite websites. For example, I regularly use the below script to log into my ISP login page to connect to the internet.

;Open webpages
 F1::Run "https://windowsloop.com"
 return

9. Open Folders

Just like with applications and websites, you can also open your favorite folders with the shortcut of your choice. In my case, I use the below script to launch my most-used folders like Downloads.

;Open folders
 #1:: Run("Explorer `"D:\Audiobooks`"") ;Win + 1
 return

10. Put Windows to Sleep

This is one of my favorite scripts on the list. When I go away from the computer, I quickly put the system into Sleep mode using the below command.

;Put Windows to Sleep - Win + Shift + F12
#+F12::
   ;Sleep/Suspend:
{ 
   DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
   return
} 

11. Right-hand Alt-Tab

The Alt-Tab keyboard shortcut is one of the most useful features in Windows. It allows you to quickly switch between Windows with little to no effort. However, if you are a left-hand mouse user, Windows has no option to use the same functionality with the right hand. I’ve already written a detailed article on how you can add right-hand alt-tab functionality in Windows with AutoHotKey. Do check it out.

12. Window Always on Top

It’s not every time but there will be situations where you need to have a window always on top. For example, maybe you are working on a spreadsheet and need the Calculator to be always on top or you’d like to watch movies while working, etc. In cases like that, use the below script.

I’ve also written a post detailing other different ways to keep a window always on top. Take a look at it if you are curious.

;Window always on Top
 ^SPACE:: WinSetAlwaysontop(, "A") ; Ctrl + Space
 return

13. Minimize Active Window

It happens all the time where you might be accessing your personal information like the bank account and your colleague is taking a peek over your shoulders. In those situations, you can use this handy script to quickly minimize the active window with a single key press.

Note: To minimize all open windows, you can press the built-in Windows keyboard shortcut Win + D.

;Minimize active window
!::WinMinimize("A") ; Alt + `
return

14. Turn Off Screen When Locked

When you lock Windows, the screen stays turned on. It’s just a waste of power. Use the below script to automatically turn off the screen when you lock Windows.

;Turn off monitor after locking system
 L::  ;; Win + L
 {
 Sleep(1000)
SendMessage 0x0112, 0xF170, 2,, "Program Manager"
DllCall("LockWorkStation")
 }
 return

15. AutoCorrect

While typing, it is quite natural to make spelling mistakes. Using AutoHotKey, you can correct the most common spelling mistakes automatically. Download the AutoHotKey autocorrect script from the official website and run it.

As long as the script is running in the background, the most common spelling mistakes will be automatically corrected for you. If needed, you can edit the downloaded script to add your own autocorrect items.

16. Search in Google for Selected Text

No matter where you are in the system, if you can select the text, you can search for it in Google. All you have to do is keep the script running in the background, select the text, and press the key binding.

In case you are wondering, you can modify the URL in the code to use your favorite search engine.

; Google Search select text - Ctrl + Shift + C
 ^+c::
 {
  Send("^c")
  Sleep(50)
  Run("http://www.google.com/search?q=" A_Clipboard)
  Return
 }
return

17. Insert Special Characters

Special characters can be easily inserted with the alt codes or using the Character Map utility in Windows. However, if you are frequently using a special character, like copyright or trademark, you can make AutoHotKey insert it when you press a shortcut.

;Insert special character
!q::SendInput("{™}") ; Alt + Q
return

That is all for now. I will try to update the article as I find more useful AutoHotKey scripts for most users. If you have any scripts, do share them in the comments form below.

Update: I’ve updated all the scripts to work with AutoHotKey v2.

5 thoughts on “17 Best and Most Useful AutoHotKey Scripts To Use On Daily Basis”

  1. Avatar for wschloss

    I use PhraseExpress for similar. It seems more flexible and more capable, though both programs definitely have a learning curve. For instance you can assign a PE keyboard shortcut to F4, but tell PE to enable it in all programs (the default) but disable, for instance, for Excel, where it has the specific, very usefully purpose of toggling formula ranges through absolute and relative references.

  2. Avatar for Chris Nelson

    I have a number of hotstrings that I use in Excel in place of user-defined functions (UDF) or other VBA macros.

    For example, there’s no built-in function in Excel to place the Worksheet name onto a cell, but I often want that in order to build formulas that use indirect references to it … or I just want a cell to reflect the worksheet’s name. Ditto for Workbook name, and ditto for the file’s Path. (Note that in order for these to work, the file must have been saved at some point prior to using.)

    ::this_workbook::=MID( CELL( “filename”, $A$1), FIND( “[“, CELL( “filename”, $A$1)) {+} 1, FIND( “]”, CELL( “filename”, $A$1)) – FIND( “[“, CELL( “filename”, $A$1)) -1){Down}

    ::this_worksheet::=RIGHT( CELL( “filename”, $A$1), LEN( CELL( “filename”, $A$1)) – FIND( “]”, CELL( “filename”, $A$1))){Down}

    ::this_path::=LEFT( CELL( “filename”, $A$1), FIND( “[“, CELL( “filename”, $A$1)) -1 ){Down}

    The {Down} in all of those is simply to move the cursor downward one cell and enable the formula’s evaluation in the cell.

    I’ve got others, but these are a few of my most-used “autocorrects” in Excel.

  3. Avatar for IFF

    Thanks for your insights. I’m looking for a way to replicate Alt+Tab behavior but just for spreadsheets on the same book and your examples are giving me hope.

    You might want to take a second look at your code for “2. Launch Applications”.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top