10 Cool AutoHotkey Scripts (And How to Make Your Own!)
AutoHotkey is a free scripting language that allows users to automate everyday tasks and improve their productivity. Whether you’re a programmer or a regular computer user, AutoHotkey can save you time and make your life easier. In this article, we’ll look at 10 of the coolest AutoHotkey scripts and show you how to make your own.
1. Launch Apps with Hotkeys
One of the simplest AutoHotkey scripts is to launch your favorite apps with hotkeys. For example, you can assign a hotkey to open your web browser, email client, or music player. Here’s an example:
#z::Run chrome.exe
#x::Run outlook.exe
#c::Run spotify.exe
In this script, pressing the Windows key and the Z key will launch Google Chrome, the Windows key and the X key will launch Microsoft Outlook, and the Windows key and the C key will launch Spotify.
2. Hotkey for Emoji
If you love to use emojis in your messages or social media posts, you can create a hotkey to easily insert them. Here’s an example:
::smile::😃
::heart::❤️
::laugh::😂
Now, whenever you type “smile,” “heart,” or “laugh,” it will be replaced with the corresponding emoji.
3. Find and Replace Text
Using AutoHotkey, you can easily automate the tedious task of find and replace text in any application. Here’s an example:
#f::
Send ^f
Sleep 100
SendInput search_text{Tab}replace_text{Enter}
Return
With this script, pressing the Windows key and F will open the Find dialog box, enter the search text, and the replacement text, and then press Enter to replace all occurrences of the search text with the replacement text.
4. Automatically Type Text
If you frequently have to type the same text repeatedly, AutoHotkey can make your life easier. Here’s an example:
::email::youremail@email.com
::phone::555-555-5555
Now, whenever you type “email” or “phone,” it will be replaced with your email address or phone number.
5. Control Media Playback
AutoHotkey can also be used to control media playback. Here’s an example:
#Left::Send {Media_Prev}
#Up::Send {Media_Play_Pause}
#Right::Send {Media_Next}
In this script, pressing the Windows key and the left arrow key will play the previous track, the Windows key and the up arrow key will play or pause the current track, and the Windows key and the right arrow key will play the next track.
6. Window Management
AutoHotkey can be used to manage windows on your desktop as well. Here’s an example:
#Left::WinMove A,,0,0,A_ScreenWidth/2
#Right::WinMove A,,A_ScreenWidth/2,0,A_ScreenWidth/2
With this script, pressing the Windows key and the left arrow key will move the active window to the left half of the screen, and pressing the Windows key and the right arrow key will move the active window to the right half of the screen.
7. Mouse Jiggler
If you’re tired of your computer going to sleep or locking the screen when you’re away, you can create a mouse jiggler with AutoHotkey. Here’s an example:
#z::
SetTimer, Jiggle, 5000
Return
Jiggle:
MouseMove, 0, 0, 1, R
MouseMove, 0, 0, 1, R
Return
In this script, pressing the Windows key and Z will activate the mouse jiggler, which will move the mouse every five seconds to keep your computer from going to sleep or locking the screen.
8. Paste Unformatted Text
If you frequently copy and paste text from different sources, you may notice that the formatting is often different. AutoHotkey can help you paste unformatted text. Here’s an example:
^v::
ClipSave := ClipboardAll
Clipboard:=
Send, ^v
ClipWait, 1
Clipboard:= RegExReplace(Clipboard, “\p{C}+”, ” “)
Sleep, 50
Send, ^v
Clipboard := ClipSave
ClipSave =
Return
With this script, pressing the Ctrl and V keys will paste unformatted text.
9. Clipboard Manager
AutoHotkey can also be used to create a clipboard manager. Here’s an example:
#v::
Send, ^c
ClipWait, 1
If ErrorLevel
Return
ClipSaved := ClipboardAll
Clipboard :=
Clipboard = %Clipboard%`n`n(Clipboard:)[%A_Now%]
ClipWait, 1
Clipboard := ClipSaved . Clipboard
ClipSaved =
MsgBox, 64, Clipboard, % Clipboard
Return
In this script, pressing the Windows key and V will copy the selected text and append it to a clipboard log, which can be retrieved by pressing the Windows key and V again and then pressing OK in the message box.
10. Look Up Word
Lastly, here’s an AutoHotkey script to look up a selected word in an online dictionary:
#d::
clipboard= ; Start with an empty clipboard
SendInput, ^c
ClipWait, 1 ; Wait for the clipboard to fill
If ErrorLevel
return
Run, http://www.dictionary.com/browse/%clipboard%, Max
return
In this script, pressing the Windows key and D will look up the selected word in the Dictionary.com website.
Conclusion
AutoHotkey is a powerful tool that can help you automate tasks, increase productivity, and save time. The above 10 scripts are just some of the many examples of what you can do with it. So, give it a try and see how it can improve your daily computer usage!