Tool of the Week: Autocorrect Macros with AutoHotkey

Although I'd much rather be coding all day, a good part of my job involves writing e-mail and creating documentation.  And since both can tend to be boring and repetitive, I saw those activities as new avenues for coding.

I found a great (free!) tool called AutoHotKey, a macro language for Windows that allows you to add code for anything and everything you see on the screen.  It's really quite deep, providing for certain actions based on what window is currently selected.  Back in Windows XP and Vista days, I had a macro written that closed the desired application in the taskbar with a middle click of the mouse.  I haven't revisited the script since Windows 7 hit the scene, but I'll bet there's a way to do it.


#SingleInstance force

MouseGetPos, , , id, control
WinGetClass class, ahk_id %id%

if (control = "ToolbarWindow322" || control = "ToolbarWindow324") {
    Send {RButton}{Esc}{Esc}
    WinGetActiveTitle currentWindow

    if (currentWindow != "") {
        WinClose %currentWindow%

    else {
        Send {MButton}

else {
    Send {MButton}

What I do use AutoHotkey for on a daily basis is a global auto-correct.  Rather than leveraging Microsoft Word's autocorrect feature, I'll add to my existing script whenever I have a new abbreviation that I want spelled out or a new typo that I'll inevitably make so it can be applied across any application.  It's also useful for repetitive stuff: if I type "ssf", it'll replace it with:

... and it will automatically move the cursor above the "WHERE" clause so I can immediately type the table name in the SQL query.  Here's a sample of my autocorrect macro:
::ktnx::ok, thanks
::ktny::ok, thank you
::np::no problem
::ssf::SELECT *{enter}FROM {enter}WHERE {up}
::ty::Thank you
I know I've barely scratched the surface of AutoHotKey.  It's a full-blown programming language and I've just documented it like it's just a simple toy.  But even though I don't have a full grasp of its power, I'm still able to get it to perform simple feats that make redundant parts of my life just a little bit more automated and a little less repetitive.

Tool of the Week: Sending Faxes With HelloFax

It may not be that often that a developer needs to use a fax machine.  For some of us, having one nearby is one of the perks of working in an office building.  For others, taking a trip to the local copy shop can take a good deal of your time, cash out of your wallet, and gas out of your car.   I don't like using up more time, money, or even paper than I need.

So when I recently had to send a constantly-revised contract back and forth, I finally took a fresh look at the web-based faxing services.  It's not necessarily a new concept, scanning a document, uploading it, typing in a fax number and hitting send, but I was a bit embarrassed that I hadn't looked at these services  before spending about $20 (no joke) at FedEx while coping with two paper jams and some frustrated looks at the folks waiting to use the fax too.

The first service I tried, HelloFax, was the one I've stayed with.  I learned about it on Lifehacker and I liked the fax fact that the first few pages I sent were free.  I could upload different types of documents (PDF was my doc of choice) and they could even whip up a free cover page on the fly.  I hated creating cover pages; the Word template I created just never seemed to format right.

HelloFax didn't betray the fact I'm cheap and that I didn't use a real fax machine when it came time for me to send out some documents.  Only if you choose to use a cover page generated by the service, it'll add the phrase "Powered by HelloFax" on the page.  But otherwise, no ads.

Its interface is clean and allows you to edit your document by adding text, checkboxes, and even signatures (uploaded, drawn with your mouse, or taken as a picture from your phone and e-mailed to a special e-mail address).

Sending faxes is queue-based; when you click "send", you can walk away and the fax is sent in short order.  You can even get an e-mail (with an attached copy of what was sent) notifying you when the send is successful.

The service is free if all you want to do is send 5 pages-- which can be spread over one or more faxes)-- then it's 99 cents to send a fax up to 10 pages (then 20 cents per page after that).  If you visit their site through a referral link like this one, they'll give you 5 more free pages on sign-up.

There are pay plans, which I have not tried.  The cheapest plan, at $5 per month, offers 50 pages a month and you're given your own local phone number to receive faxes as well.  The higher-tiered plans offer more and more pages and still seem like a good deal if your life involves being chained to a fax machine.