Friday, May 16, 2008

AutoHotkey: Keyboard Automation at its finest

I work at a keyboard all day and find myself entering the same text over and over again. I write code/sql queries and sometimes would think to myself "You know, it would be nice if the computer could just read my thoughts and put what I'm thinking down to paper..er screen"

So I came across a program that lets me get close to what I desire. It drastically helps the entering of repeated text over and over again and can be configured to do way much more then that.

The program, is AutoHotkey.

This is a program that can take various keystrokes, or keystroke combinations to preform various tasks on the computer. You're most likely familiar with CTRL-C, CTRL-V, or maybe even the windows shortcuts WIN-M (minimize all), WIN-L (Lock computer), WIN-E (Open Explorer). The program above can be setup in such a way that you can either change or add to the default hotkeys on your computer.

Another of it's features is the ability to replace text as you type. As I said before I type a lot of SQL code so after setting up the program above, I setup the following "replacements" that definitely help as I manually enter SQL statements.
sf : SELECT * FROM
df : DELETE FROM
wc : WHERE cState = 'NE'
ami : AND nMajInt =
So if I happen to want all the records from table sUsers where cState = 'NE' and nMajInt = 1234. This is what I would type:
sf sUsers wc ami 1234
The resulting text into the editor would be:
SELECT * FROM sUsers WHERE cState = 'NE' AND nMajInt = 1234
Now if you can't see the time savings in that, your either blind, or don't have to type that much in your day to day activities.

I also use it to do various table manipulations that I often encounter, so I entered the following replacements as well:
atj : ALTER TABLE jlw_x DROP COLUMN nRowID
GO

dtj : DROP TABLE jlw_x
GO
iej : IF EXISTS (SELECT * FROM dbo.sysobjects where id = object_id(N'[jlw_x]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [jlw_x]
GO
For each, all I type is the three letters and a space, the program then automatically replaces them with their associated values. (Keep in mind my examples here are not AutoHotkey scripts, just a way for me to present the functionality)

AutoHotkey is not just limited to replacing text. Like I mentioned before it can be configured to run pretty much anything on the computer, or to simulate almost any input device. I have a few programs that I almost always want to run when I start the computer (but not always!) So I setup a special Windows hotkey (WIN-Q) that when activated will launch the 7 different programs I need. Or I find that I always open a new notepad session to jot down quick notes either while on the phone or if someones standing nearby and I need to take down info quickly. Therefore I setup CTRL-ALT-N to launch a new notepad session.

I definitely recommend at least trying it out to see if you find it usefull. If you're not very technically inclined there is a very well written guide on its website that details all the various features and how to use them.

Wednesday, May 14, 2008

Summer To Do List

So I figured I'd throw together a list of things I want to do this summer. This will range from various concerts I plan on attending, to projects around the house (both little and big)

Date Specific:
  • Sister Hazel - June 21st
  • Red, White & Boom (311, Snoop, POD, Kottonmouth Kings) - July 2nd
  • Mile High Music Fesitval - July 19-20th
  • Kansas City (Worlds/Oceans of Fun, Baseball Game)- Weekend of August 1st
  • The Faint - August 23rd
Non-date Specific:
  • Finish Etching Living Room Mirror
  • Paintball
  • Camping
  • Tubing down the Niobrara
  • Mini Putt-putt golf
  • Fontenelle Forest
  • Jet Skiing/Lake Activities
If any friends who read this are interested in any of those activities, let me know and we'll setup a date(s) to go out and do it.