Skip to content

Windows automation tool Autohotkey | Automate common task with Autohotkey |

If you do some repetitive tasks and wish if you could automate it. Then you have come to the right place. No more wasting time in doing mundane task when you can automate it with Autohotkey, the free Windows Automation tool.

AutoHotkey is a free, powerful and versatile Window Automation tool that allows you to automate almost anything on your Windows PC. No need to spend money on Windows automation software when you can get it for free. Be it a simple tasks to open your favorite application to sophisticated tasks like multiple clipboard, Autohotkey allows you to automate any things.

You can download Autohotkey from from https://www.autohotkey.com/. Its size is less than 5 mb and easy to install.

First Autohotkey Script for Window Automation

To write your first Autohotkey just open notepad or any other text editor and type following code and save file with .ahk extension. To run it, just double click it. You can confirm it by seeing H symbol in notification area of your task bar.

#n:: 
run notepad
return

Congratulation, you have successfully created shortcut for to open notepad. You can just press “Win + n” to open notepad. Whats great is that you can stop this script any time. To stop this script from running just right click on H symbol in notification area and click stop script.

Keyboard Shortcut to open program

With Autohotkey, you can open any software/program with keyboard shortcut. Infact you can customize your keyboard shortcut to open particular program. Following script shows how you can automates opening of notepad++ by just pressing “Win” + “N”. Not that first line of code #n:: is shortcut where # stands for Windows key. Second line is for running notepad++ and Return in 3rd line is for telling AHK that this is end of script. Now you can customize your own shortcut for opening your own program.

#n::
run notepad++
return

Auto correct commonly miss typed word with Autohotkey

Microsoft word and many other programs have feature of correcting wrongly spelled word as you type. But this capability is limited only for those software. With Autohotkey, you can extend auto correct capability windows wide. Following code auto correct teh to the anywhere in windows. You are free to add more such auto correct capability. AHK script for auto correct containing most commonly misspelled words please visit.

:*:teh::the
:*:enviorment::environment
:*:knwo::know

Auto expand abbreviation with Autohotkey

There are times where many wish if there they could set shortcut for some word or phrase like “Happy Birthday!!!” or some kind of shortcut for Signature in mail. With Autohotkey you can exactly do that. Following script converts hbd to Happy Birthday !!! automatically as you type. You can add your own version of shortcut that expands automatically on typing.

::hbd:: Happy Birthday !!!

Search text on Google or Wikipedia or any other website

In todays world, who don’t search things in Google or Wikipedia. While reading some article/documents you would have definitely searched for some text from article in Google or Wikipedia to know more about it. This process requires copying selected text, opening browser and searching it. But with autohotkey, you can search for any text on Google or Wikipedia with just one keystroke. Just select any text and press designated shortcut key and let AHK to open your favourite browser and search for the selected word. Use following script and press “Windows + G” and “Windows + W” to search the selected text in Google and Wikipedia. Try this now!!!

#g::
OldClipboard:= Clipboard
Clipboard:= ""
Send, ^c ;copies selected text
ClipWait
Run http://www.google.com/search?q=%Clipboard%
Sleep 200
Clipboard:= OldClipboard
Return

#w::
OldClipboard:= Clipboard
Clipboard:= ""
Send, ^c ;copies selected text
ClipWait
Run http://en.wikipedia.org/wiki/Special:Search?search=%clipboard%
Sleep 200
Clipboard:= OldClipboard
Return

Reassign keys with Autohotkey

Be it a issue with your keyboard or want to use some rarely used keys for something more useful. With Autohotkey, you can reassign key or change functionality of keys. Following sample script shows how you can reassign Numlok key as new Shift key.

Numlock::Shift
Return

This one is my Favorite. I am sure that many of you are using Insert, Scroll lock or Numlock keys very very rarely. With autohotkey you can reassign these rarely used keys to do some useful like Search in Wikipedia key, etc. Following sample script shows how you can use Insert key as Search in Google key.

Insert::
OldClipboard:= Clipboard
Clipboard:= ""
Send, ^c ;copies selected text
ClipWait
Run http://en.wikipedia.org/wiki/Special:Search?search=%clipboard%
Sleep 200
Clipboard:= OldClipboard
Return

Toggle Between your favorite window

With lot many windows open, sometime you may have to regularly minimize some particular windows like chrome. With autohotkey, you can maximize/minimize your favourite window with just one keystroke. Following sample script shows how you can, use Alt+c (! stands for Alt in AHK) to toggle chrome (minimize -> maximize or maximize -> minimize)

ToggleWinMinimize(TheWindowTitle)
{
SetTitleMatchMode,2
DetectHiddenWindows, Off
IfWinActive, %TheWindowTitle%
{
WinMinimize, %TheWindowTitle%
}
Else
{
IfWinExist, %TheWindowTitle%
{
WinGet, winid, ID, %TheWindowTitle%
DllCall("SwitchToThisWindow", "UInt", winid, "UInt", 1)
}
}
Return
}
!c::ToggleWinMinimize("Chrome")

Conclusion

Autohotkey is versatile light ware, freeware and robust software by which you can create shortcut for virtually any thing in Windows. Example give above are just glimpse of what Auto-hotkey can do. Possibility is just limitless

1 thought on “Windows automation tool Autohotkey | Automate common task with Autohotkey |”

  1. Pingback: Remapping Keys in Windows using PowerToys for free [2024]

Leave a Reply

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