Wednesday, March 12, 2008

Taking Hotkeys a Step Further


Now that you've got an idea of how to create hotkeys the simple way, we'll move on to slightly more advanced hotkey creation. First, we'll create a simple hotkey that will open Lifehacker when we press Windows-l (who wouldn't rather read Lifehacker than lock their desktop?). Quite simply, it looks like this:


In this example, we're using the Run command, which can take any target—from web URLs to files on your hard drive—and, quite simply, open them.

As a result, creating a keyboard shortcut to launch anything at all is a breeze. You can launch any program, document, or web page with a simple shortcut of your choosing. If you were creating an iTunes shortcut with Windows-i (where the Windows key equals the pound sign [#]), for example, it might look something like this:


You'll noticed I introduced another concept here: variables. The variable %A_ProgramFiles% tells AutoHotkey to look in my default Program Files directory—in my case, "C:\Program Files". I could have just made the command Run, C:\Program Files\iTunes\iTunes.exe, but using the variable means that—assuming I've got iTunes installed—the same shortcut will work on other computers that have iTunes installed to the default directory, even if their home drive is D:\ or F:\. For more on variables, check out AutoHotkey's introduction to variables, along with their list of built-in variables (like %A_ProgramFiles%).


Post a Comment

Related Articles

Related Article Widget by Hoctro

About Me


Hi, I am Hua, a chinese expat residing in India excited about windows, linux and all things tech

Receive updates for free

Enter your email address:

Delivered by FeedBurner

Mobile Version


Bookmark and Share

Blog Archive