Recent CP News

Create Windows Shortcut Using a Scripting Language

Windows Shortcut Using a Scripting Language

Shortcut Shortcut…Have you ever wanted to do everything in Windows with a simple key combination? This trick will let you open, say Google, with a key combination of Alt+G or Ctrl+G or anything else of your choice.

This will barely take 2 minutes to learn.

There is this very simple tool called Autohotkey. This tool does the following things:

  1. Define hotkeys for the mouse and keyboard, remap keys and buttons and autocorrect-like replacements.
  2. It can create standard Graphical User Interfaces with controls for entry presentation.
  3. Parse feeds from a variety of sources for processing and manipulation with regular expressions.

The above image shows one such usage.

Say,  you are sending an email to someone and you end with a signature at the end which is routine. Why write it every time? Instead just automate it.
Pressing Ctrl + Alt +S will add your signature to the Email.
Also, “btw”, will expand to “by the way”. There are many such uses.

How Is It Used?

To use AutoHotkey, follow these steps:

  1. Install AutoHotkey from here: autohotkey
  2. Right-click an empty spot on your desktop or in a folder of your choice.
  3. In the menu that appears, select New -> AutoHotkey Script. (Alternatively, select New -> Text Document.)
  4. Type a name for the file, ensuring that it ends in .ahk. For example Test.ahk
  5. Right-click the file and choose Edit Script.
  6. On a new blank line, type the following:
    #space::Run www.google.com

In the line above, the first character “#” stands for the Windows key; so  #space means holding down the Windows key then pressing the spacebar  to activate the hotkey. The:: means that the subsequent command should be executed whenever this hotkey is pressed, in this case, to go to the  Google web site. To try out this script, continue as  follows:

  1. Save and close the file.
  2. Double-click the file to launch it. A new icon appears in the taskbar notification area.
  3. Hold down the Windows key and press the spacebar. A web page opens in the default browser.
  4. To exit or edit the script, right-click the green “H” icon in the taskbar notification area.

There it is. You have just used the Windows Key+Space to open google.com.

{Code With Codeater}

Give Your Reviews




Leave a Reply