Alex Watt

About Blog Hacks Recommendations

Saving Keystrokes with AutoHotkey

Have you ever copied and pasted something from the Web or another document, only to find that the formatting came along?

I discovered text expanders from Michael Hyatt in the past year, and immediately went hunting for a free one. I chose AutoHotkey (Windows only); and while I thought I would use it only as a text expander, there are other uses.

  1. Copy and paste without the formatting

    This script is triggered with CTRL + WIN + V (instead of CTRL + V), and pastes without the formatting. Thanks to this forum post.

    ^#v::                            ; Text–only paste from ClipBoard
       Clip0 = %ClipBoardAll%
       ClipBoard = %ClipBoard%       ; Convert to text
       Send ^v                       ; For best compatibility: SendPlay
       Sleep 50                      ; Don't change clipboard while it is pasted! (Sleep > 0)
       ClipBoard = %Clip0%           ; Restore original ClipBoard
       VarSetCapacity(Clip0, 0)      ; Free memory
    Return
    
  2. Signature blocks, canned responses, and frequently requested information (like phone number or address). This is, perhaps, the most obvious use for AutoHotkey.

    Note that the following script converts tsig into a signature block. You might define addr to be your address, celln to be your cellphone number, etc.

    ::tsig::Thank you,{Enter}{Enter}Your Name Here
    
  3. Making spelling and style simpler

    As an example, I’m a fan of the em dash, and have defined two hyphens to be converted to an em dash with AutoHotkey. That way, I can get it to work in any application, not just the Office suite. (I may also add something for left and right quotation marks.)

    Similarly, if you misspell certain words frequently, perhaps flipping letters due to fast typing, you might configure AutoHotkey to fix it for you.

    ::--::—
    ::teh::the
    

The AutoHotkey tutorial is here, and if you like the program, don’t forget to have it start automatically.

What are your favorite scripts?

Posted on 12 Aug 2014.