Jack’s AutoHotkey Blog

Download AutoHotkey Tricks You Ought To Do With Windows (Sixth Edition) PDF File

This AutoHotkey Tricks Book Includes “Table of Contents” and “Indexes” from Jack’s AutoHotkey Books!
(For other e-book formats click here!)

Get Free AutoHotkey Scripts!

ComputorEdge Free AutoHotkey Scripts Page

The Best Type of Brain Food!
Get Started with AutoHotkey with These Books!


*          *          *

Library Benefits

November 23, 2020

More references for Chrome.ahk Web page automation tools: Moving Forward with AutoHotkey Chrome.ahk Tools

November 16, 2020

Writing Javascript Expressions: Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 2)

November 9, 2020

Analyzing HTML Code: Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)

November 2, 2020

First Chrome.ahk Web page automation post: “Installing Chrome.ahk AutoHotkey Web Page Automation Tools

October 26, 2020

Fasten your seat belts! We’re about to dive into Web page automation. After this first intro to screen-level automation (“Automating Web Pages with AutoHotkey“), it can become a real mindbender.

October 21, 2020

Coming soon! A new series of blogs on solving the problems with automating Web page.

October 19, 2020

A beginner’s review of the AutoHotkey GUI pop-up controls: “Create Instant Windows Gadgets Using AutoHotkey Graphical User Pop-ups (GUIs)


Joe Glines recently released a new AutoHotkey course targeting AutoHotkey GUIs. Here’s a link to the course “How to make a Graphical User Interface / GUI with AutoHotkey.”

October 12, 2020

Updated the SynonymLookup.ahk script to get it working again: Fixing AutoHotkey Web Lookup Scripts.

October 5, 2020

Sending Multiple Saved Data Items to Documents and Forms in AutoHotkey (Temporary Hotkeys)

September 28, 2020

AutoHotkey Object-Oriented Notation for Associative Arrays (A Short Intro)

September 23, 2020


A solution for a Hotstring capitalization problem: “AutoHotkey Quick Tip: Conditional Hotstrings Using the Input Command.”

September 21, 2020

Track Graphic Line Measurement Segments Using AutoHotkey Arrays

September 14, 2020

Measure Multiple Line Segments with an AutoHotkey On-Screen Ruler

September 7, 2020

Pass-Through Hotkey Combinations to Prevent Shortcut Blocking (AutoHotkey Tip)

Click the Follow button at the top of the sidebar on the right of this page for e-mail notification of new blogs. (If you’re reading this on a tablet or your phone, then you must scroll all the way to the end of the blog—pass any comments—to find the Follow button.)

Continue reading

Moving Forward with AutoHotkey Chrome.ahk Tools

My Last Three Blogs Offer a Basic Introduction to Installing and Running the Chrome.ahk Web Page Automation Tools—Find More Resources for these Useful Functions

In my earlier blogs, I posted a beginner’s introduction to GeekDude’s Chrome.ahk Web page automation tools:

I wrote these columns to bridge the gap between the novice-level user and the videos produced by GeekDude and Joe Glines—even causing me to take time to allow the techniques to ferment in my brainpan. While the videos provide excellent information, they assume a certain level of user experience. Hopefully, my blogs provide enough insight to allow new users to:

  1. Develop a basic understanding of how Chrome.ahk functions facilitate the completion of Web forms while highlighting the complications from HTML and Javascript code.
  2. Make a decision about whether they will continue to pursue these Web automation techniques.

After this reference blog, unless someone asks me specific questions about Chrome.ahk, I intend to move on to other topics.

Continue reading

Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 2)

How to Write Javascript Code for Web Page Automation Using AutoHotkey Chrome.ahk Tools—Digging into the Quirks of Javascript

In my last blog (“Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)“), I discussed how to reveal Web page control names in the source code. This time, I explain how to use those control names to write Javascript expressions for inserting data into text fields and activating menu items and buttons.

Javascript Code

HTML code creates the Web page structure—including editing fields, menus, and buttons. We use Javascript commands to initiate action within the static HTML Web. The functions found in Chrome.ahk AutoHotkey tools use Javascript expressions to send commands to the active Web page by channeling those directives through a Chrome debugger channel. You must use Javascript to communicate with the Web page.

Continue reading

Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)

Analyze Web Page HTML Code to Find Control Names and/or IDs for Writing Javascript Expressions for Automating Web Forms Using the Chrome.ahk Library

Logging into online accounts ranks as one of the most common motivations for AutoHotkey users automating Web pages. Using screen-level AutoHotkey Web page automation can get cumbersome. For more reliable and accurate solutions consider source-level automation using the AutoHotkey Chrome.ahk Library of tools. However, before automating any Web forms with these functions, you need to accomplish two tasks:

  1. Analyze the Web page to identify the target HTML controls’ name or id (e.g. text fields, buttons, etc).
  2. Write Javascript action expressions for use with the Chrome.ahk library.

In this blog, I introduce how to identify the controls required to fill in a Web form. In my next blog, I’ll address the more complex task of writing the Javascript expressions for Web page input.

Continue reading

Installing Chrome.ahk AutoHotkey Web Page Automation Tools

Although It Comes with a Bit of a Learning Curve, the Chrome.ahk AutoHotkey Library Offers More Precise Source-Level Web Page Automation

(Updated November 5, 2020) Last time, I highlighted the limited techniques available for automating Web pages at the screen-level. The Web browser insulates the user from the underlying HTML and Javascript page code preventing the use of control names for automating Web pages.

This time, I introduce source-level Web page automation running a short test script after installing a set of Google Chrome AutoHotkey source-level Web page automation tools—Geekdude’s Chrome.ahk Library. I’ve set up a test page called “Jack’s AutoHotkey Chrome Test Page” for a quick trial of the tools. (When initially viewing the test Web page, you should see a set of three empty input fields: First Name, Last Name, and Street Address.) In this blog, I discuss how to install and set up the Chrome.ahk tools—then access the setup by running a sample AutoHotkey script that automatically fills in the three input fields:

The test script inserts data into the three input fields, then displays a Chrome message box displaying, “Hello World!”

If you can get this test script running with your Chrome browser, then a totally new world of Web page automation opens up.

Continue reading

Automating Web Pages with AutoHotkey

When Automating Tasks, Browser Web Pages Present Special Problems

Due to the nature of the Internet and the function of Web browsers, AutoHotkey users encounter particular issues when automating Web pages. AutoHotkey GUIs (Graphical User Interfaces) and many older Windows programs allow direct access to controls for automation. Newer apps tend to use ribbon menus which usually include accessible Alt+key shortcuts. However, Web browsers contain built-in protections which insulate users and make controlling operations more opaque. The average Web surfer only has access to what appears on the screen. Getting to the inner workings of Web browsers requires special tools.

After receiving a request from a Web browser, the Web server sends code consisting of HTML and JavaScript to that Web browser. The Web browser interprets the code and sends the results to the computer screen in the form of text, images, links, and controls. The Web browser sends back any user actions requiring server action.
Continue reading

Create Instant Windows Gadgets Using AutoHotkey Graphical User Pop-ups (GUIs)

One of the Easiest and Quickest Means for Building a Short, Useful PC App Takes Advantage of AutoHotkey GUI Controls—A Review for the Novice Scriptwriter

Many of my sample scripts available at the Free ComputorEdge AutoHotkey Scripts page use the built-in Graphical User Interface (GUI) tools available in the Windows operating system. Taking advantage of these Windows mechanisms demonstrate only one of the many reasons why the free AutoHotkey scripting language affords so much power. With a few lines of code, you can build Windows gizmos for an innumerable variety of applications. The GUI pop-up acts as the primary core for many AutoHotkey scripts. Easy-to-use and only requiring a minimum amount of programming, the GUI makes possible Windows gadgets for almost any use.

While almost all of my books discuss how to use GUIs in a number of different ways, the book AutoHotkey Applications: Ideas and Tips for Writing Practical AutoHotkey Scripts spends a great deal of time discussing various AutoHotkey Graphical User Interface (GUI) pop-ups with example scripts.

Continue reading

Fixing AutoHotkey Web Lookup Scripts

If a Web Page Changes Format, the Data-Extracting Regular Expressions (RegEx) May Need Updating—Fixing the SynonymLookup.ahk Script

When writing a blog, I tend to use certain words over and over again. While rereading early versions, these redundant words jump out at me. Not only do they point out my limited vocabulary, but the repetitions tend to render my blogs a little more starchy and boring. That’s why I often resort to my always-loaded SynonymLookup.ahk script. This app saves time while making me look a little smarter.

The current version of SynonymLookup.ahk script lists more possibilities and marks antonyms (most of the time) with a caution sign (). (Click image for expanded view.)

After I discover a duplicated word, I highlight it, then hit the Ctrl+Alt+L Hotkey combination. A menu of possible replacements pops up. I click on the one that best fits my intent and the new term immediately displaces the original text. I habitually use this script.

When the SynonymLookup.ahk Script Breaks

Over the life of the script, I’ve encountered the menu shown at right a couple of times. This menu pops up whenever the script downloads and scans the source code 10 times without getting a RegEx hit—usually the result of code changes made by the source page Webmaster.

Continue reading

Sending Multiple Saved Data Items to Documents and Forms in AutoHotkey (Temporary Hotkeys)

Sometimes We Want Single-key Hotkeys to Work Only for Short Periods of Time

The press of a single key provides the easiest method for inserting data into an edit field or document. In AutoHotkey, you can activate any key as that quick action single-key with either a Hotkey or Hotstring. However, in the normal course of work, that technique renders that keyboard action useless for anything else. To get the convenience of one-key instant activation, we must activate that Hotkey when needed—only in specific circumstances and for short periods of time.

AutoHotkey offers a number of different methods for accomplishing this instant key action. Which we choose depends upon what we want to do. In this blog, I look at three different methods:

  1. Use the Hotkey command to temporarily turn Hotkeys on then off again.
  2. Use the #If directive to designate conditional Hotkeys.
  3. Temporarily pause the script after Hotkey activation, then deactivate Hotkeys upon resuming.

While each temporary Hotkey works in a similar manner—activating only when needed—each has its advantages and disadvantages.

Continue reading

AutoHotkey Object-Oriented Notation for Associative Arrays (A Short Intro)

Special Object-Oriented Syntax Makes It Easier to Retrieve Array Data

I hesitate to discuss Object-Oriented Programming (OOP) in AutoHotkey. I haven’t work with it enough to provide the insight I would like when addressing a topic. When reading online tutorials, I have a tough enough time understanding the explanations. I have yet to see a tutorial that makes it simple. So, I concentrate on the pieces that get results right now without going too much into the weeds.

From what I’ve read, OOP acts as the de facto standard for professional programmers—not without controversy (“Object-Oriented Programming Is Bad?“). They say that the planning and organization which comes with using OOP makes life easier for multiple people toiling on large projects. While this approach to programming may work for large projects, it does not necessarily make life easier for short apps such as most AutoHotkey scripts.

Continue reading

AutoHotkey Quick Tip: Conditional Hotstrings Using the Input Command

Sometimes the Input Command Solves a Sticky Hotstring Problem

* * *

I promised an associative array tutorial for my next blog, but this topic intervened. I should have the tutorial ready for next Monday.

* * *

Recent comment on my blog “Auto-Capitalize the First Letter of Sentences“:

This routine can be handy, though the main issue is that, in AHK, “if more than one hotstring matches something you type, only the one listed first in the script will take effect”. Actually, I’m not sure about that, as it appears that using the asterisk as a hotstring option takes precedence. In any case, this does seem to have the effect that other hotstrings that could otherwise be used cannot be used if they also match the code provided here. I have lots of those types of hotstrings, which I use on new lines and after punctuation. I have been unable to find any solutions to this since AHK does not accommodate sequential firing.

A short demo:


Run this script. Type “Tn” on a new line. It works to type “Thanks”. Now type “tn” on a new line. The first line in the script is now skipped. You see only “Tn” in response.

Comment On “AutoHotkey Tip of the Week: Auto-Capitalize the First Letter of Sentences” by mikeyww

Whenever a Hotstring fires, it resets and waits for the next Hotstring. Therefore, the firing of the new line character and “t” (`nt) removes the letter “t” from the next string and starts over with the “n” character. The asterisk option (*) does not affect this behavior. It merely causes that Hotstring to fire before the first—then reset—prior to pressing the “n” key. However, I do appreciate the problem.

Continue reading