Search This Blog

Friday, January 28, 2011

How to use AutoHotKey as a text expander


Once you’ve installed AutoHotKey you can have it auto complete text for you.  This can save a lot of time on anything you type frequently. 

Here’s a walkthrough on how you can create an auto complete script with AutoHotKey:

1.)    Create a new script by right-clicking anywhere on the desktop. Then click on ‘New’ and then ‘AutoHotKey script’.

2.)    Open the file you just created by right-clicking on it and clicking ‘Open with’ and then select ‘Notepad’.  Note: if you just double-click the file it runs the script and you won’t see anything.

3.)    To set up a text expander function:
If you want to set up a key sequence to expand text then you can model your script after one of the examples below. For example, you could make typing ‘billyjoe@’ (without the quotes) automatically become  ‘billyjoe@gmail.com’.  If you’re setting up to have it automatically complete it’s important to have the key sequence be separate from your everyday typing.  Let’s say, for example, you set the key sequence ‘bi’ to auto complete to billyjoe@gmail.com.  Then every time you try to type ‘bike’ when the script is running you’ll end up with billyjoe@gmail.com.  So, it needs to be a unique combination.  You can also set it up to expand the text after typing ‘bi’ + the Enter key.  Any key sequence will work.  Below I’ve shown how to do this in option 2.

Option 1:
Type the following text into the bottom of an AutoHotKey script so that every time you type ‘billyjoe@’ it will autocomplete as ‘billyjoe@gmail.com’:

:*billyjoe@::billyjoe@gmail.com
Return


Option 2:
Type the following text into the bottom of an AutoHotKey script so that every time you type ‘bi + Enter’ it will autocomplete as ‘billyjoe@gmail.com’:

                                    ::bi::billyjoe@gmail.com
Return

The difference between the two is seen in the first part of the script. ‘:*’ Tells it to auto complete after typing the subsequent keys and ‘::’ tells it to auto complete after typing the subsequent keys and the enter key.

4.)    Save the file.
5.)    Right click on the script on the desktop and select ‘Compile Script’.
6.)    Double-click it to run the script.



Now type in your key sequence and watch it expand like magic.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...