ComputorEdge E-Books

ComputorEdge

Table of Contents      Beginner's Guide Index

Beginner's Guide

A Beginner's Guide to AutoHotkey


"Absolutely the Best Free Windows Utility Software Ever! Create Power Tools for Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10"
 
AutoHotkey makes learning to write Windows apps easy for anyone who desires to make their computing life simpler. In fact, getting started in the free AutoHotkey software is so easy that it's the fastest way to learn how to make Windows more productive. You'll be amazed at how quickly you can add AutoCorrect to your writing and speed up your work with Hotkeys. If you can open Windows Notepad, then you can create your own quick, yet powerful apps.

This third edition is in response to reader comments. For Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10, AutoHotkey is the most powerful, flexible, free Windows utility software available. Anyone can quickly add more of the special features they want to all of their Windows programs, whether installed on their computer or while working on the Web. AutoHotkey has a universality not found in any other Windows utility--free or paid.The beauty of AutoHotkey is that it works with any Windows program (word processing, spreadsheet, presentation, e-mail) or in any Web page or Blog—plus it's free!

There are literally hundreds of free AutoHotkey apps available for adding to or adapting for your Windows computer. (Do a Google search on the key words "ComputorEdge AutoHotkey apps" for examples.) Find out how easy it is to do!

For this edition, numerous tips, updates, and comments (most marked as Third Edition notes) give more insight into both AutoHotkey techniques and the state of the AutoHotkey language while targeting the beginner level. Each chapter has at least one or two new tips or updates.


For an EPUB (iPad, NOOK, etc.) version of A Beginner's Guide to AutoHotkey click here!

For a PDF version for printing on letter size paper for inclusion in a standard notebook of A Beginner's Guide to AutoHotkey click here!

(Also, MOBI format for Kindle is available from ComputorEdge Books, as well as, from Amazon for the Kindle and Kindle software on other devices.)

(Get the Spanish language version of
A Beginner’s Guide to AutoHotkey—Guía básica de AutoHotkey—from Amazon.)

Table of Contents to "A Beginner's Guide to AutoHotkey"

Chapter One: How to Become a Windows Computer AutoHotkey Superhero

"An Introduction to AutoHotkey features. The best way to keep your job (or get a new one) is make yourself more valuable."

Most small offices have one or two people who have made themselves the in-house IT group. Without the job title, they apply their knowledge to keeping the computers running. Now there is another way to add to superhero status by making it easier to use Windows computers with AutoHotkey.

Chapter Two: Programming Is for Everyone

"Don't think you can program? Think again! Writing software scripts is not just for nerds."

Many people avoid programming because it looks too mysterious and complicated. However, it's really not all that hard. Most people could benefit from writing a little bit of code for their unintelligent computer.

Chapter Three: Installing AutoHotkey and Writing Your First Script

"AutoHotkey, an often overlooked utility program, could become your best friend for your PC."

Some people avoid AutoHotkey because it requires scripting. However, once you understand the possibilities there is plenty of incentive to learn a little coding. Here's how to install AutoHotkey and write your first script.

Chapter Four: More Basic AutoHotkey Techniques

"Changing the case of text from upper to lower and back again."

After introducing the free AutoHotkey utility program in the last chapter, Jack adds a few more techniques which can be used immediately by anyone with a Windows computer.

Chapter Five: Sharing AutoHotkey Scripts

"Compile your AutoHotkey scripts into an executable (EXE) file, plus restoring the original clipboard contents."

There is no need to install the complete AutoHotkey program on every computer. All you need to do is compile your scripts for use on any Windows computer. Plus, how to restore the original Clipboard contents after an AutoHotkey operation.

Chapter Six: Instant Search and Replace

"StringReplace to search and replace any text, anywhere, anytime using Loop and If."

So far we've demonstrated straightforward text substitution and manipulation. Now it's time to do search and replace for multiple items using a Loop and If.

Chapter Seven: Cool Date Tricks with AutoHotkey

"Enter the current date into any Windows program automatically."

AutoHotkey includes tools that make it easy to enter the time and/or date into your documents and files. There is even a cool pop-up calendar for picking alternative dates.

Chapter Eight: Powerful Screen Object Controls in AutoHotkey

"Using the Graphic User Interface (GUI) controls in AutoHotkey to build simple gadgets."

The addition of screen objects to AutoHotkey scripts increases the number of ways that you can use what is "absolutely the best free Windows utility ever." To see the possibilities, peruse the chapter or just look at the pictures.

Chapter Nine: Automatically Resizing Windows with AutoHotkey and User-Defined Functions

"Write a user-defined function for resizing windows to exact dimensions on your desktop."

AutoHotkey includes commands for manipulating the position and size of windows. Including these commands in a user-defined function will add more flexibility to your Windows computing.

Chapter Ten: Make Any Window Always-on-Top Anywhere, Anytime, Plus More "If" Statements

"Using AutoHotkey to make a window always-on-top."

Using AutoHotkey for always-on-top and using "If" conditionals to solve some window size and location problems.

Chapter Eleven: Opening Useful Hidden Windows Folders with AutoHotkey and Making a Help Pop-up

"An easier way to open hidden Windows folders, such as Startup...plus more AutoHotkey and an AutoHotkey help pop-up!"

It can be difficult to find some of the important Windows system folders. Here is the secret to opening them quickly. Then, add this technique to an AutoHotkey script to make it even easier. Also, how to make a pop-up Help window in AutoHotkey.

Chapter Twelve: Cleaning up the Desktop

"A tip for organizing Windows Desktop clutter and more power with AutoHotkey Replace."

Using program icons to quickly recognize new folders used for common file types, plus use AutoHotkey for e-mail addresses and adding "boilerplate."

Chapter Thirteen: Disabling Annoying Windows Hotkeys

"It's easy to Delete All when the Control key is next to the Shift key."

While most Windows hotkey combinations are very useful, there are times when you may want to disable one or two of them. There is a quick and easy way to do that in AutoHotkey.

Chapter Fourteen: AutoHotkey for Copying and Moving Files

"If copying files become tedious with a mouse, it may be time for AutoHotkey."

For copying and moving files, Windows is a point-and-click operating system. Sometimes it's just easier to write a short AutoHotkey script to manipulate file locations.

Chapter Fifteen: How to Cheat at Computer Games and Restarting with AutoHotkey Action Recorders

"AutoHotkey is great for empowering your avatar, plus automatic script creators for beginners."

One of the most popular uses for AutoHotkey is automating computer games. Plus, did you get bogged down with learning AutoHotkey? Actions recorders such as AutoScriptWriter can give you a fresh start.

Chapter Sixteen: Common AutoHotkey Messages and Errors Encountered by the Novice

"Here are a few issues every beginner should understand."

While all AutoHotkey users encounter these warnings and errors at some time, they can cause a great deal of frustration for the beginner. Here is how to deal with them.

Index to "A Beginner's Guide"

$ in front of hotkey combination; Chapter Fifteen
#SingleInstance Off; Chapter Sixteen
#UseHook; Chapter Fifteen
%variable% to return value; Chapter Four
:*: instant auto-replace; Chapter Twelve
:O: option, auto-replace no space; Chapter Twelve
` accent/backtick (special character); Chapter Eleven
`n, special character; Chapter Eleven
`t, special character; Chapter Eleven
= versus := equivalence; Chapter Four

A—Index to "A Beginner's Guide"

A, Active window; Chapter Ten
A_UserName; Chapter Fourteen
Accent/backtick (`); Chapter Eleven
Activating an AutoHotkey Script; Chapter Three
Active window, A; Chapter Ten
Add GUI sub-command; Chapter Eight
Add icon to Windows folder; Chapter Twelve
Adding dates to documents; Chapter One
Adding dates to documents, Notepad (F5); Chapter One
Adding Gui objects; Chapter Eight
Adding the date; Chapter Seven
Adding the time; Chapter Seven
AHK extension; Chapter Three
Always-on-Top; Chapter One, Chapter Eight, Chapter Ten
AutoHotkey (AHK) scripts; Chapter Two
AutoHotkey Dropbox download Web site; Chapter Eight, Chapter Thirteen
AutoHotkey Web Site; Chapter Eleven
AutoHotkey Web Site; Chapter Three
AutoHotkey_L (Current Version); Chapter Three
AutoHotkey_L Web site; Chapter Eleven, Chapter Fourteen
Automatic Loading of AHK Scripts; Chapter Five
Automatic Loading of EXE apps; Chapter Five
Auto-replace, instant (:*:); Chapter Twelve
Auto-replace, no space (:O:); Chapter Twelve
Automating computer games; Chapter Fifteen
AutoScriptWriter; Chapter Fifteen

B—Index to "A Beginner's Guide"

Batch (BAT) files; Chapter Two
Blank spaces, removing; Chapter Three
Blocking annoying windows hotkeys; Chapter Thirteen
Boilerplate, inserting; Chapter Twelve
Buddy control (Gui, Add, UpDown); Chapter Eight
Button GUI; Chapter Eight
ButtonSubmit; Chapter Seven

C—Index to "A Beginner's Guide"

Calculate time and date; Chapter Seven
Calculator, Launch; Chapter Three
Calendar, Pop-up; Chapter One
Calorie Counting app; Chapter Eight
Capitalization; Chapter Four
Cartoon, Hotkeys; Chapter Three
Cartoon, Robots; Chapter Two
Cartoon, Superhero; Chapter One
Centering windows on the screen; Chapter Ten
Character, special, escape sequences; Chapter Eleven
Clipboard contents saving old; Chapter Five
Clipboard, search and replace; Chapter Three
Clipboard, using; Chapter Four
ClipWait command; Chapter Four
Closing a window hides it; Chapter Sixteen
Command Reference; Chapter Fourteen
Commands built into AutoHotkey; Chapter Four
Comments; Chapter Fourteen
Common, errors and messages; Chapter Sixteen
Compile into executable file (EXE), how-to; ChapterThree, Chapter Five
Compiled (EXE) file, AddDate.exe; Chapter Seven
Compiled programs; Chapter Two
Compiler; Chapter Two
Compiling and Sharing AutoHotkey Scripts; Chapter One
Compiling AutoHotkey files; Chapter Thirteen
Computer games automating; Chapter Fifteen
Computer screen size, Program Manager; Chapter Ten
Conditional If statement; Chapter One, Chapter Nine
Conflicting hotkey combinations; Chapter Three
Continue reading next line; Chapter Eleven
Convert .ahk to .exe program; Chapter Five
Convert to lowercase; Chapter Four
Convert to uppercase; Chapter Four
Copying and moving files; Chapter One, Chapter Fourteen
Create a new AutoHotkey script; Chapter Three
Create a new Windows folder; Chapter Twelve, Chapter Fourteen
Create an AutoHotkey (AHK) script file; Chapter Seven
Curly brackets {}; Chapter Nine, Chapter Ten

D—Index to "A Beginner's Guide"

Date calculation; Chapter Seven
Date/Time stamp; Chapter Seven
DateTime GUI; Chapter Eight
Deactivate an AutoHotkey script; Chapter Three
DetectHiddenWindows command; Chapter Sixteen
Differences in AutoHotkey_L; Chapter Three
Dimensions, window,; Chapter Nine
Disable the Windows logo () hotkeys; Chapter Thirteen
Disabling annoying Windows hotkeys; Chapter Thirteen
Disabling or overriding hotkeys; Chapter Thirteen
Distribute scripts to other computers; Chapter Three
Download ComputorEdge AutoHotkey scripts; Chapter Eight
Dropbox folder; Chapter Thirteen

E—Index to "A Beginner's Guide"

Edit GUI control; Chapter Eight
Edit Script; Chapter Seven
E-mail addresses, auto-replace; Chapter Twelve
Error, Variable exists; Chapter Seven, Chapter Sixteen
Error, "Variable cannot be used for more than one control."; Chapter Sixteen
ErrorLevel; Chapter Six
Errors and messages; Chapter Sixteen
Escape sequences; Chapter Eleven
EXE AutoHotkey files; Chapter Thirteen
Executable (EXE) file; Chapter Two, Chapter Five

F—Index to "A Beginner's Guide"

FileCopy; Chapter Fourteen
FileCopyDir; Chapter Fourteen
FileCreateDir; Chapter Fourteen
FileMove; Chapter Fourteen
FileMoveDir; Chapter Fourteen
FileSelectFile; Chapter Fourteen
Files, moving and copying; Chapter One, Chapter Fourteen
Folder, create; Chapter Fourteen
Folder, Windows, Startup, Program Files, and SendTo; Chapter Eleven
Folders, Windows System, Opening; Chapter One
FormatTime command; Chapter Seven
Formatting time; Chapter Seven
Functions, User-Defined; Chapter Nine

G—Index to "A Beginner's Guide"

G-label option; Chapter Eight, Chapter Sixteen
Gaming scripts; Chapter Fifteen
Generating scripts; Chapter Fifteen
Get window title (name); Chapter Fourteen
Global variables; Chapter Seven
Google search code; Chapter Three
Gosub; Chapter Sixteen
Graphic image tools (GUIs); Chapter One
Graphic User Interface (GUI) examples; Chapter Eight
GroupBox GUI; Chapter Eight
GUI (Graphical User Interface) command; Chapter Seven
Gui, +AlwaysOnTop; Chapter Eight
Gui names in combined scripts (eliminating conflicts); Chapter Sixteen
GUI positioning, (ym); Chapter Eight
GUI variables; Chapter Seven
Gui, Add; Chapter Eight
Gui, Add, Checkbox; Chapter Eight
Gui, Add, ComboBox; Chapter Eight
Gui, Add, DateTime; Chapter Eight
Gui, Add, DropDownList; Chapter Eight
Gui, Add, Edit; Chapter Eight
Gui, Add, GroupBox; Chapter Eight
Gui, Add, Hotkey; Chapter Eight
Gui, Add, ListBox; Chapter Eight
Gui, Add, ListView; Chapter Eight
Gui, Add, Picture; Chapter Eight
Gui, Add, Progress; Chapter Eight
Gui, Add, Radio; Chapter Eight
Gui, Add, Slider; Chapter Eight
Gui, Add, Tab; Chapter Eight
Gui, Add, Text; Chapter Eight
Gui, Add, TreeView; Chapter Eight
Gui, Add, UpDown; Chapter Eight
Gui, Destroy command; Chapter Sixteen
Gui, Font; Chapter Eight
Gui, Font, Norm; Chapter Eight
Gui, Show; Chapter Eight
Gui, Submit; Chapter Eight

H—Index to "A Beginner's Guide"

Hidden systems folders, open; Chapter One
Hidden windows, detecting; Chapter Sixteen
Hiding windows; Chapter Sixteen
Hook, keyboard; Chapter Fifteen
Hotkey GUI; Chapter Eight
Hotkeys cartoon; Chapter Three
Hotkeys, Gui objects; Chapter Eight
Hotstring replace "imho" to "in my humble opinion"; Chapter Three
Hotstring replacement (e-mail address); Chapter Two
Hotstring replacement (IMHO); Chapter One
Hotstrings and Auto-replace; Chapter Twelve
Hotstrings options; Chapter Twelve

I—Index to "A Beginner's Guide"

Icon for the AHK file; Chapter Five
Icon for the EXE file; Chapter Five
Icon in the Notification area; Chapter Three
Icon, add to Windows folder; Chapter Twelve
If conditional; Chapter Ten
If statement; Chapter One
If statement in loop; Chapter Six
If statement, conditional; Chapter Nine, Chapter Ten
IfEqual statements; Chapter Ten
IfNotExist; Chapter Fourteen
ImageSearch; Chapter Fifteen
Infinite loop; Chapter Six, Chapter Fifteen
Initial capitalization; Chapter Four
InputVar; Chapter Four
Inserting boilerplate; Chapter Twelve
Installing AutoHotkey; Chapter One, Chapter Three
Instant auto-replace (:*:); Chapter Twelve
Instant Hotkey; Chapter Eight
InstantHotkey app; Chapter Sixteen
Interpreted programs; Chapter Two
Interpreted versus compiled programs; Chapter Two

K—Index to "A Beginner's Guide"

Keyboard hook; Chapter Fifteen
KeyWait command; Chapter Fifteen

L—Index to "A Beginner's Guide"

Label (subroutine); Chapter Seven
Label does not exist error; Chapter Sixteen
Launch Windows Calculator; Chapter Three
Launch Windows Notepad; Chapter Three
Limiting window size; Chapter Ten
Line continuation; Chapter Eleven
ListBox GUI; Chapter Eight
ListView GUI; Chapter Eight
List of hotkeys; Chapter Seven
Load on login, Startup folder; Chapter Five
Loop; Chapter Six
Loop, break; Chapter Six
Lowercase, conversion; Chapter Four

M—Index to "A Beginner's Guide"

Macro recorders; Chapter Fifteen
Making a Help pop-up; Chapter One
Making an EXE file; Chapter Five
Manipulating windows in Windows; Chapter One
Missing label error; Chapter Sixteen
MonthCal GUI (Graphical User Interface); Chapter Seven, Chapter Eight
Morons; Chapter Two
Move a window; Chapter Nine
Moving and copying Windows files in AutoHotkey; Chapter One, Chapter Fourteen
MsgBox command; Chapter Eleven
MsgBox, (Message Box); Chapter One
MsgBox, adding options numbers; Chapter Eleven
MsgBox, Help; Chapter Eleven

N—Index to "A Beginner's Guide"

Naming GUIs in combined scripts; Chapter Sixteen
Next line, continue reading; Chapter Eleven
No space auto-replace (:O:); Chapter Twelve
Notepad, adding the date; Chapter Seven
Notepad, Launch; Chapter Three
Notification area Icon; Chapter Three

O—Index to "A Beginner's Guide"

"Older instance of this script is running" message; Chapter Sixteen
Omission of Gui, Submit; Chapter Seven
Opening hidden Windows systems folders; Chapter One, Chapter Eleven
Organizing for AutoHotkey; Chapter One
OutputVar; Chapter Four

P—Index to "A Beginner's Guide"

Paste the date into any document; Chapter Seven
Pause scripts with Sleep; Chapter Four
Picture GUI; Chapter Eight
PixelSearch; Chapter Fifteen
Pop-up, calendar; Chapter One
Pop-up, Help; Chapter One
Position window; Chapter Nine
Positioning Gui objects; Chapter Eight
Program Files Windows folder; Chapter Eleven
Program Manager, computer screen variable; Chapter Ten
Programming; Chapter Two
Programming, Why learn?; Chapter Two
Progress GUI; Chapter Eight
Pulover's Macro Creator; Chapter Fifteen

R—Index to "A Beginner's Guide"

Recorders, script; Chapter Fifteen
Recorder by Titan; Chapter Fifteen
Regular Expressions (RegEx); Chapter Six
Reload an AutoHotkey script; Chapter Three, Chapter Sixteen
Reload saved script, System Tray icon menu; Chapter Seven
Reload This Script, System Tray icon menu; Chapter Seven
Relocate a window; Chapter Nine
Removing blank spaces; Chapter Three
Replacement, text; Chapter Three; Chapter Fourteen
Resize windows; Chapter One
Return command; Chapter Four
Right-click AutoHotkey menu; Chapter Seven
Robots cartoon; Chapter Two
Run command; Chapter Eight
Run command; Chapter Eleven
Run Script; Chapter Seven
Run www.google.com; Chapter Eight
Running an AutoHotkey Script; Chapter Three
Running AutoHotkey apps on any Windows computer; Chapter Five
RunWait; Chapter Eleven

S—Index to "A Beginner's Guide"

Saving old Clipboard contents; Chapter Five
Screen size variable, Program Manager; Chapter Ten
Screen, centering windows; Chapter Ten
Script, writing your first AutoHotkey; Chapter Three
Script recorders; Chapter Fifteen
Scripting; Chapter Two
Scripts, AutoHotkey (AHK); Chapter Two
Scripts, AutoHotkey Dropbox folder; Chapter Thirteen
Search and replace; Chapter One
Search and replace, text; Chapter Three
Search Google code; Chapter Three
Selecting files; Chapter Fourteen
Selecting hotkey combinations; Chapter Three
Send command; Chapter Seven
Send command; Chapter Four
SendInput; Chapter Fifteen
SendPlay; Chapter Fifteen
SendTo Windows folder; Chapter Eleven
Sharing AutoHotkey Scripts, Compiling; Chapter One
Shell Windows command; Chapter Eleven
Shell: command; Chapter Eleven
Shell:common startup; Chapter Eleven
Shell:ProgramFiles; Chapter Eleven
Shortcuts in Startup, Tip; Chapter Five
Sleep command; Chapter Four
Slider GUI; Chapter Eight
Special character escape sequences; Chapter Eleven
Startup folder for load on login; Chapter Five
Startup folders; Chapter One
Startup folders, two different; Chapter Five
Startup folders, use shortcuts (Tip); Chapter Five
Startup folders, Windows Tip; Chapter Five
Startup Windows folder; Chapter Eleven
StatusBar GUI; Chapter Eight
StringLower; Chapter Four
StringReplace; Chapter Six; Chapter Fourteen
StringUpper; Chapter Four
Submit button; Chapter Seven
Submit, GUI; Chapter Seven
Subroutine (Label); Chapter Seven
Superhero cartoon; Chapter One
Syntax error; Chapter Two

T—Index to "A Beginner's Guide"

Tab GUI; Chapter Eight
"Target label does not exist."; Chapter Sixteen
Text GUI; Chapter Eight
Time calculation; Chapter Seven
Time formatting; Chapter Seven
Title, get window; Chapter Fourteen
To-Do List app; Chapter Eight
TreeView GUI; Chapter Eight

U—Index to "A Beginner's Guide"

UpDown GUI control; Chapter Eight
Uppercase, convert to; Chapter Four
UseErrorLevel; Chapter Six
User-defined Functions; Chapter One, Chapter Nine
User-friendly software; Chapter Two
Using the Windows Clipboard; Chapter Four

V—Index to "A Beginner's Guide"

"Variable cannot be used for more than one control." error; Chapter Sixteen
Variable exists error; Chapter Seven, Chapter Sixteen
Variable, global; Chapter Seven
Variables and Expressions; Chapter Four

W—Index to "A Beginner's Guide"

Wildcards, * and ?; Chapter Fourteen
Window position; Chapter Nine
Window size, limiting; Chapter Ten
Window, always-on-top; Chapter Ten
Window, dimensions; Chapter Nine
Window, move; Chapter Nine
Windows Aero; Chapter One
Windows Explorer icon for the AHK file; Chapter Five
Windows Explorer, right-click AutoHotkey menu; Chapter Seven
Windows folders, Startup, Program Files, and SendTo; Chapter Eleven
Windows System Folders, Opening; Chapter One
Windows Tip for opening Startup folder; Chapter Five
WinGetPos; Chapter Nine, Chapter Ten
WinGetTitle; Chapter Fourteen
WinMaximize; Chapter Nine, Chapter Ten
WinMinimize; Chapter Nine, Chapter Ten
WinMove; Chapter Nine, Chapter Ten
WinRestore; Chapter Ten
WinSet; Chapter Ten
WinShow commands; Chapter Sixteen
Writing Your First Script; Chapter One, Chapter Three

X—Index to "A Beginner's Guide"

XButton; Chapter Fifteen


This edition with more chapters and an index to the AutoHotkey commands found in the book is available in e-book format from Amazon (and other formats—EPUB and PDF— at the ComputorEdgeBooks Web site linked below). Jack's A Beginner's Guide to AutoHotkey, Absolutely the Best Free Windows Utility Software Ever!: Create Power Tools for Windows XP, Windows Vista, Windows 7 and Windows 8 (preferred, EPUB format for iPad, Android, and computers; MOBI for Amazon Kindle; and PDF for printing) offers a gentle approach to learning AutoHotkey. (Also available from Amazon for the Kindle and Kindle software on other devices.)

Building Power Tools for Windows XP, Windows Vista, Windows 7 and Windows 8, AutoHotkey is the most powerful, flexible, free Windows utility software available. Anyone can instantly add more of the functions that they want in all of their Windows programs, whether installed on their computer or while working on the Web. AutoHotkey has a universality not found in any other Windows utility—free or paid.

Based upon the series of articles in ComputorEdge, Jack takes you through his learning experience as he explores writing simple AutoHotkey scripts for adding repetitive text in any program or on the Web, running programs with special hotkeys or gadgets, manipulating the size and screen location of windows, making any window always-on-top, copying and moving files, and much more. Each chapter builds on the previous chapters.

For an EPUB (iPad, NOOK, etc.) version of A Beginner's Guide to AutoHotkey click here!

For a PDF version for printing on letter size paper for inclusion in a standard notebook of A Beginner's Guide to AutoHotkey click here!

(Get the Spanish language version of A Beginner’s Guide to AutoHotkey—Guía básica de AutoHotkey—from Amazon.)

*                    *                    *


ComputorEdge