How to Use Macros to Simplify Your Life

By JR Raphael
Contributing Writer, [GAS]

Here’s an offer too good to refuse: Take every tedious, repetitive task that wastes your time…and automate it. The cost? Two minutes to read this article, and maybe five more to do what it says. Interested? Read on.

What we’re about to do will save you precious time and mental energy. Unfortunately, it only applies to tedious tasks at your PC – not real-life repetition like doing laundry or washing dishes – but for those of us who spend hours in front of a screen, it can make a world of difference.

Meet the macro

A macro is basically a series of commands that is “taught” to your computer, then condensed down to one simple keystroke, or hotkey, to run. Now, Windows does have the ability to let you use some basic hotkeys. For example, I have key sequences set up to run programs I use often, like CTRL-SHIFT-W to launch Microsoft Word (just right-click any icon, go to “Properties,” then “Shortcut key” to do this). But a true macro lets you do far more.

There are plenty of programs that will let you create and run macros. I’m focusing on one called AutoHotKey. It’s free, easy to set up and use, and incredibly powerful.

Five steps to automation

We’re going to make this very simple.

1) Download and install AutoHotKey.
2) Open Notepad. We’re going to create a new text file. On the first line, we’ll type what hotkey we want to define, followed by two colons.

^ means CTRL and ! means ALT.
The next lines will tell the program what action to perform for that hotkey.

For this example, we’ll set CTRL – ALT – A to change our font to Arial, size 11, in Microsoft Word. So we’d type:

Send !of

That tells AutoHotKey that whenever we type CTRL – ALT – A, it should send out ALT – O – F (which would open the “Format” menu, then the “Font” box). It will then type the word “Arial,” tab over twice, then type the number “11,” then hit enter. That’s the same key sequence you’d make to manually change to Arial 11.

3) Save the file anywhere you want. You can call it anything, as long as it has the extension .AHK.
4) Now just run the file, and you’re set. Any time you’re in Word, CTRL-ALT-A will now change your font to Arial 11.
5) Assuming you want this new hotkey to always be available, all you need to do is create a shortcut for it (right click the icon, select “Create a Shortcut”) and move the shortcut into your Startup folder (in the Windows Start menu).

Exploring your options

This is just the tip of the iceberg when it comes to what you can do with AutoHotKey. You could set it to replace abbreviations with longer text – for example, any time you type “tfc,” it changes it into “Thanks for contacting me” (just create a new text file and type ::tfc::Thanks for contacting me on the first line, then save it like we did above). You can also get into far more complex macros, including ones that will let you move and resize windows, remap keys and mouse buttons, and customize your system in ways you never knew possible.

Check out the full list of commands here and some examples of ready-to-run advanced scripts here.

Word of warning

Remember, this program has the power to interact with your operating system and make major changes. If you aren’t familiar with programming and advanced Windows functionality, stick with the basic stuff or the ready-to-run scripts from above.

Now if you’ll excuse me, it’s time for me to run my macro to save this article, convert it into plain text, and upload it to the web site. Happy hotkeying!

Geeks are Sexy needs YOUR help. Learn more about how YOU can support us here.