AUTOHOTKEY FOR BEGINNERS

AUTOHOTKEY FOR BEGINNERS

A power user is always in search for shortest way to perform task. If you are using BTW as a short form for By the Way in your Chats you know what we mean. There are some ways to perform large and complex things in a computer just via shortcut (a hotkey, get it?). AutoHotKey is one of our favorite and most powerful.

 

Why AutoHotKey?

It is a free open source application and it is really powerful, using this tool you can even remap keys on your Joystick. You can define shortcuts for many tasks and launch many operations and processes just by keystroke. A practical example? When I was writing this article, I knew i will have to type AutoHotKey several times so I set “ahk” to expand to AutoHotKey – that was the simplest one. I have remapped my Capes Lock key to send an Alt+Tab so that I can cycle through running programs easily. AutoHotKey may seem a little bit difficult to understand at first but is really useful.

Getting the Basics

Autohotkey is used to make scripts (don’t worry! they are much easier then programming). The extension of a script is .ahk (example:  hotkeyscript.ahk) an AutoHotKey script can be made by using pretty much any text editor. After you have done scripting you can save the script in an .ahk extension and then simply double click on the script to run it. You can see the icon of AutoHotKey in your notification tray. From there you can Pause, Edit and Stop the script. Now that you have got the basics, let’s begin.

STARTING UP

First point your Web-Browser to here to download AutoHotKey.

Next you have to install it. After the installation is done you are good to go.

Creating a AutoHotKey Script

To create a script in any folder, right click on empty space and then point to New > AutoHotKey Script

AUTOHOTKEY FOR BEGINNERS

 

Now give your new script a cool name and then don’t’ open it – that is useless, the script is currently empty.

Now right click the empty script, it will be opened in notepad and you will see something like this.

 

As you can see there is nothing useful here, so let’s begin.

AUTOHOTKEY FOR BEGINNERSThe Rules of AutoHotKey Scripts

  • Every sentence starting with ; is a comment.
  • # is used to denote the WIN key on your keyboard.
  • ^ means CTRL button
  • ! means ALT button
  • + means shift button.

All the work in AutoHotKey script is done in two parts. First is the part before the  :: which defines when and after the :: defines what to do

An example:

AutoHotKey

 

#C means WIN+C and the latter means to send ALT+F4 (of course to close the active window)

There are a lot more things which we will face when they come.


 

Task 1: Making a Shortcut to Open a Website

To create a shortcut to open a website in your default web browser you have to type something like this:

KEYBOARD SHORTCUT :: run WEBSITE URL

As an example if you want to open THEBIGCOMPUTING.COM using combination WIN+T you will have to enter the following text.

#t::run http://www.thebigcomputing.com

Now save the script using CTRL+S and Double click on the saved file, you will see the AutoHotKey icon in notification area too. Now whenever you will press WIN+T you will reach here, you are free to change the shortcut and the destination site.

FOR REAL BEGINNERS: #n denotes WIN+N if you want to use WIN+CTRL+N then you will have to enter #^t (got it?)


TASK 2: Creating Shortcuts to Type Large Text

You can easily expand your text using abbreviations – Believe us that is easier even then task one.

The syntax should be like this:

:: SHORTFORM :: TEXT TO REPLACE

That’s it! Example? Take a look-

::btw::by the way

::skt::Saurabh Tripathi

::tbcmail::thebigcomputing@gmail.com

REMEMBER: you can always add as many as definitions in one script.

 

Those were just the basics of AutoHotKey, we will explain even more advanced, useful and complex AutoHotKey stuff in our upcoming articles. To stay tuned and get notification do sign up for newsletter on the sidebar. Got any queries or suggestions? Please drop your comment.


Original Image Credits: remko van dokkum

Share