Work more efficiently with the free AutoHotkey tool

AutoHotkey (abbreviated as AHK) is a macro recorder, its name says it all, this program can save a sequence of keyboard and mouse sequences and then let you redo them. Here's an application case where you can use AutoHotkey to increase your productivity.

Network Administration - In this article, I will introduce you to a small, free utility that is quite useful. This is one of the best ways that can make your computers work exactly what you want.

AutoHotkey (abbreviated as AHK) is a macro recorder, its name says it all, this program can save a sequence of keyboard and mouse sequences and then let you redo them. Here is an application case where we use AutoHotkey.

  1. Create shortcuts with AutoHotkey

Install AutoHotkey

Before you can try some scripts or write your own script, you need to install AutoHotkey.

After installation is complete, the program will execute the scripts you write in AutoHotkey language, but there are no scripts to run. To create a new script, make sure AutoHotkey is running (by opening the Start menu and typing AutoHotkey to run the program), then right-click anywhere on the desktop or anywhere else conveniently and choose New> AutoHotkey Script . Name it and make sure the file ends with. ahk otherwise it will not work correctly.

If you're writing a script for AutoHotkey, you should upgrade your text editor. Notepad ++ is a great free option and is recommended for this purpose. Note that you can open your text editor, type some code and simply save it with the .ahk extension and you'll get the same result as the above method.

Now you have the scripting software, now just download the code that others wrote to automate all kinds of jobs. To save a script, just download it as a .ahk file and save it wherever you want.

If you want one of these scripts to run as soon as you start your computer, you can copy and paste the .ahk files into the Startup folder by typing shell: startup into the Start menu or browsing to the following location:

C: Users [USERNAME] AppDataRoamingMicrosoftWindowsStart MenuProgramsStartup.

Picture 1 of Work more efficiently with the free AutoHotkey tool

The best AutoHotkey scripts

Here are some of the best scripts you can use to make Windows better.

1. Turn your Caps-Lock key into a Mute button

Have you ever wished you could mute computer speakers for a moment, just like when your phone rings, you need to have a quiet space to make your conversation. Some computer keyboards have a Mute button to accomplish that purpose, but not all keyboards are available.

If your keyboard doesn't support the Mute button as mentioned above, don't worry too much or think of buying a new keyboard, we'll show you how to turn the usual Caps-Lock key on your keyboard. Make a Mute button with AutoHotkey.

Run AutoHotkey and follow the order below:

1. Run Notepad.
2. Copy and paste the following line into the Notepad document: CapsLock :: Send {Volume_Mute}
3. Save the file as Mute.ahk .
4. Double-click the file to run it.

Now, when you press Caps-Lock, your speaker system will be dumb. Pressing it again will be returned to the original open state.

If you want to temporarily disable this feature, right-click the AutoHotKey icon in the System Tray and select Suspend Hotkeys .

2. Auto-Complete when typing text

Auto-Complete is a pretty useful feature in text typing, whenever you type a previously defined abbreviation, for example, type qtm , then the AHK will replace it with the phrase " quan tri bearing ". This is a way to save a lot of time with repeating phrases many times in any editor.

Here is how to set Auto-Complete in AHK

  1. Run AutoHotkey.
  2. In certain open areas on the desktop, right-click on it and select New, AutoHotkey script.
  3. Enter the name of the script (in this case qtm.ahk ) and press Enter .
  4. Right-click this file and select Edit Script.
  5. Find a blank line and type in it :: qtm :: bring
  6. Choose File, Exit, and save your changes.
  7. Right-click the file and select Run Script.

Now, whenever you type qtm and press a space or a punctuation mark, AHK replaces it with the phrase "mind bearer ".

3. Restore the folder function of Backspace key

If you're a fan of keyboard shortcuts, you'll probably find that in Windows Vista and Windows 7, the Backspace key doesn't work the same as in Windows XP. It can still undo the characters to the left of the cursor - however when you view the folders in Windows Explorer, Backspace will not bring you up to a folder in its tree architecture as in XP.

However with AHK, you can use the following code to make the Backspace key function as it is in XP - in the folder navigation perspective. We will only provide you with the code, and the remaining steps will be similar to the sections above.

#IfWinActive, ahk_class CabinetWClass
Backspace ::
ControlGet renamestatus, Visible ,, Edit1, A
ControlGetFocus focussed, A
if (renamestatus! = 1 && (focussed = 'DirectUIHWND3 ″ || focussed = SysTreeView321))
{
SendInput {Alt Down} {Up} {Alt Up}
} else {
Send {Backspace}
}
#IfWinActive

4. Delete the text format when pasting

When you make a copy and paste a text from a certain web page into your blog tool, or Word to Web often appears unwanted formatting.
Now AutoHotkey can solve your problem with the following code:

$ ^ v ::
ClipSaved: = ClipboardAll; save original clipboard contents
clipboard =% clipboard%, remove formatting
Send ^ v; send the Ctrl + V command
Clipboard: = ClipSaved; restore the original clipboard contents
ClipSaved =; clear the variable
Return
 
$ ^ + v ::
Send ^ v; just send the regular paste command
Return

5. Delete Outlook emails with one click

You can change the function of your middle mouse button for certain programs. Using the following code in AHK will allow you to delete emails in Outlook inbox by clicking the middle mouse button on them.

;Lets delete Outlook emails with a wheel button
; By Grigory Shevchenko
# SingleInstance, Force
#NoEnv
#IfWinActive ahk_class rctrl_renwnd32
~ MButton ::
MouseClick, Left
sleep 10
Send, ^ d
return

6. AutoCorrect when typing text

This is an old script, but spelling errors are not 'outdated'. It contains thousands of common spelling errors and when you make an error, it will immediately replace it with the correct word. It even allows you to edit your own words.

Download : Script for AutoCorrect.

7. Disable the Lock key

Three Lock keys - Num Lock, Caps Lock and Scroll Lock - are not really used frequently. You can just use the numeric keypad, never press Caps Lock except accidentally click on it and don't even know what Scroll Lock is used for. Except Windows will play a sound when pressing this key, but try setting them with a default value other than this script.

; Đặt thiết bị khoá
SetNumlockState, AlwaysOn
SetCapsLockState, AlwaysOff
SetScrollLockState, AlwaysOff
return

This script will cause Num Lock keys to always turn on and disable CapsLock and Scroll Lock keys. If you want to turn off the NumLock key, you can change it to Off or delete it.

8. Reset functions for Caps Lock

Once you have used the above code to disable Caps Lock, you can set it up with another function.

Using this script will turn Caps Lock into another Shift key, you can even change it to anything you want (maybe another Windows key):

; Turn Caps Lock vào một khoá Shift
Capslock :: Shift
return

9. Quickly view or hide hidden files

If you want to access the hidden folders in windows then this is the script for you. This script simply means you press the Windows + H key with any folder to view hidden files or folders.

Download : Script to view hidden files.

10. Quickly display or hide the file extension

Similarly, sometimes you want to see the file extension of each file. This is useful if you have multiple files of the same name or want to make sure that the content you have downloaded is a PDF file and not a dangerous .exe file. The script below will allow you to enable / disable the file extension for files with the Windows + Y key .

Download : Script displays the file extension.

11. Insert special characters

Although your keyboard has some special characters (like @ or *), there are dozens of other characters you need to use and don't want to look in Symbol of Word or hunt for Alt codes. So let this AHK code help you.

  1. Have you created an icon, a character with the Alt key you know?

Using the form below to create a shortcut will be useful for you. The characters on the left are the characters you need to press to activate the shortcuts, while the symbols inside the quotes are what are inserted. So if you want to press ALT + Q to insert the trademark icon, you will type:

! q :: SendInput {™}

For references, characters for keys, you can read more about hotkey keys on the AHK manual page.

  1. ^ for CTRL
  1. ! for ALT
  1. # for Windows
  1. + for Shift

12. Mimic the Chromebook's search key

Google's Chromebook has many personal shortcuts, Google has decided to remove Caps Lock keys that are not used often and replaced with search buttons on their machines. You can also get the same functionality with a simple script.

This will launch your default browser and search Google for any text you highlighted when pressing Ctrl + Shift + C. Very handy to reduce copy and paste time.

^ + c ::
{
Send, ^ c
Sleep 50
Run, http://www.google.com/search?q=%clipboard%
Return
}

13. Use the numeric keypad like a mouse

This script will use the numeric keypad to act as a mouse, allowing you to move more accurately and in case your mouse is broken.

Download : Script using numeric keypad like mouse.

14. Launch any application

The launcher like Launchy is great for pulling any program installed on your computer in just a few seconds, but for more used programs, you may need a faster way. The following script opens a very simple application, you just need to press Windows + F to open Firefox.

#f :: Run Firefox

15. Paste into Command Prompt

Until Windows 10, you must right-click and select Paste to paste anything into a command line, the usual shortcut Ctrl + V does not work. But now with this script, you can use Ctrl + V to paste into Command Prompt as usual.

#IfWinActive ahk_class ConsoleWindowClass
^ V ::
SendInput {Raw}% clipboard%
return
#IfWinActive

The great thing about AutoHotkey is that it is fully customizable to your needs. You can set any shortcut you want with different functions.

Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile