For geeks to be more productive, using keyboards as much as possible is a must. AutoHotKey for windows is an excellent tool that can automate repetitive typing. Using scripting in AutoHotKey, you can pretty much perform any activities on Windows. This is a jumpstart guide to get you started on the AutoHotKey.
Install and Configure
- Download the AutoHotKey and install using the default options.
- Launch the AutoHotKey, which will display a dialog confirming that a sample script file will be created. Click on “Yes” to create the sample AutoHotkey.ahk in the My Documents folder. Later if you want to create a script file under a different directory, from the Windows Explore menu click on File -> New -> AutoHotKey Script.
- Make sure AutoHotKey is running in the windows task bar. You can also open the AutHotKey.ahk script by right-mouse click on the AutoHotKey icon from the system tray and select “Edit this script”.
- Anytime you make changes to the AutoHotkey.ahk, you need to Reload the script by right-mouse click on the AutoHotKey icon on the system tray and select “Reload this script”.
Basic Usage of AutoHotKey
(1) Email Signature. Add the following two lines to the AutoHotKey.ahk and reload the script as explained above. For testing, open notepad and type -rn, which will be automatically replaced with the full name “Ramesh Natarajan” as defined in the *.ahk file. Comments in the AutoHotkey.ahk begins with semi-colon.
; tip#1 - Type long names quickly ::-rn::Ramesh Natarajan
(2) Email Signature with multiple lines. In this example, typing “rtgs” from my email message will add the multiple-line content located within the parenthesis ( ). It is important to choose a keyword that you can easily remember and not common words that could potentially be replaced automatically by mistake.
; tip#2 - My personal email signature with the URL ::rtgs:: ( Ramesh <a href="https://www.thegeekstuff.com">The Geek Stuff</a> )
(3) Current Date and Time: When you are taking notes in a textpad, sometimes it may be a good idea to put the current date and time before you start taking notes. In the following example, when you type “ndate” from the notepad, it will add the current date and time in the format mentioned below.
; tip#3 - Adding the timestamp quickly while taking notes :*:ndate:: FormatTime, CurrentDateTime,, M/d/yyyy h:mm tt ; It will look like 6/29/2008 10:35 AM SendInput %CurrentDateTime% return
(4) Open a website in a browser: Sometime it may be necessary to open your frequently used website with a single key stroke. In the following example, typing “Windows” key + “t” will open the default web browser and launch www.thegeekstuff.com. Please note that “#” in the following line represents the “Windows” key in the keyboard.
; tip#4 - Open frequently used website #t::Run www.thegeekstuff.com
(5) Open frequently used folder by pressing “Windows” key + “p”.
; tip#5 - Open frequently used folder #p::Run "C:\my-project\projectplan"
(6) Open frequently used document by pressing “Windows” key + “c”
; tip#6 - Open frequently used document #c::Run open "C:\my-project\documents\codedesign.doc"
(7) Advanced scripting. In the following example, you can select any text from any application and press “Control+Alt+w”, which will open the Notepad++ application and paste the selected text.
; tip#7 - Advanced scripting ^!w:: Send, ^c SetWorkingDir, %ProgramFiles%\WordNet\Notepad++\ Run, notepad++.exe WinWait, Notepad++ WinActivate Send, ^v{Enter} return
References:
Do you use any other keyboard productivity tips? Please leave your comment.
Comments on this entry are closed.
Nice blog you have… I have subscribed to your feed via my Google Reader.
Cheers and good luck,
Ajith
PS: Thanks for visiting my blog today
Hello Ramesh ..
i found auto hotkey too, and i love it a lot !!
They have so many user scripts on the site .. i’ve only started with an autotext script, and it’s so enjoyable to use.
kind regards, michael
I agree on finding Autohotkey an essential tool for a modern professional.
I use the text replacement tricks a lot. Same thing with having scripts for launching the different browsers (Firefox, Flock, Opera., Safari and IE) with different home pages, or sets of tabs previously opened. You can use Autohotkey for many things really.
A tip that works great with Autohotkey, is to locate the script itself in the Start Folder to avoid having to activate it everytime you turn your computer on.
I just want to say thank you for making this guide.
I knew AutoHotKey was the solution to customer service repetition,
but this is really remarkable. Great tutorial. In 2 minutes of reading
you’ve already saved me two hours tonight.
So helpful. Thanks! I returned here to check some ahk code again -and to properly credit you in my .ahk scripts -since you were the inspiration for my date script. I modified the orignal idea to give me 2 options for the date: nd- and nd/. One allows for dashes in Month-day-Year. That’s mostly used for plain text notes and files needing a date string in their name. The other allows for a year, month, day in slash format for inline documentation when I’m coding or blogging.
###
; Adding the timestamp quickly while taking notes
; courtesy of Ramesh Natarajan on July 20, 2008| thegeekstuff.com
;#NoTrayIcon
#SingleInstance force
; Month Day Year string
:*:nd-::
FormatTime, CurrentDateTime,, MM-dd-yyyy
; can append at end for time –> h:mm tt |will look like: 05-04-2015 10:35 AM
; It will look like 05-04-2015
SendInput %CurrentDateTime%
return
; Year Month Day string
:*:nd/::
FormatTime, CurrentDateTime,, yyyy/MM/dd
; It will look like 2015/05/04
SendInput %CurrentDateTime%
return