More Windows Program Automation with the WinMenuSelectItem Command…Maybe (AutoHotkey Tip)

A while back I wrote a series of articles on using AutoHotkey for Windows program automation. They appeared in the old ComputorEdge Magazine. I used Windows 10 Paint as the example program demonstrating a number of approaches to program control. I temporarily put the articles in a makeshift PDF for artists and intend to include them in a future book—along with a couple of other unpublished Windows program automation articles.  I extracted some of those columns from the original ComputorEdge issues and combined them into one free PDF download: AutoHotkey for Artist.pdf. The links may be obsolete, but the info is still good!

Continue reading

Advertisements

The Main Window for Debugging AutoHotkey Scripts

How to View the Inner Workings and Hidden Mechanisms of Running AutoHotkey Scripts

AutoHotkey includes a tool called the Main Window which aids with the debugging process. It gives you a peek into various aspects of a running .ahk script:

  1. Most recently executed lines of code (ListLines command).
  2. Current variables and values (ListVars command).
  3. Active Hotkeys (ListHotkeys command).
  4. Keyboard activity (KeyHistory command).

Main Window Menu

Open the Main Window by right-clicking on Windows System Tray icon of an active .ahk script and selecting Open from the top of the menu. The window pops open at the “Lines most recently executed” view. You can select the other three views plus “Refresh” from the View menu. Continue reading

More E-Book Bundles for Beginning and Intermediate AutoHotkey Users

New E-Book Bundles for Making Your Journey into AutoHotkey Scripting Easier

JacksLibraryBookDeal250Every programmer suffers moments where he or she achieves a breakthrough and the code actually works. Their first impulse—tell someone…anyone. “Look what I just did!” Alas, they find no one nearby to praise the accomplishment. At least, no one who either understands or cares about their success. Maybe that’s why I write about my AutoHotkey journeys. I need to tell someone when (ironically?) some code I wrote does what it’s supposed to do. Continue reading

Using the Raw Option—Plus a Secret Hotstring Trick (AutoHotkey Tip)

Both Hotkey Modifiers and Special Characters Might Disappear When Used in Regular Text. Usually, You’ll Find the Raw Mode the Easiest Solution for Vanishing Characters. Plus, a Secret AutoHotkey Hotstring Trick!

*          *          *

When I started working on this blog I thought I would hammer out a simple explanation of when to use the Raw option in AutoHotkey…and to a large degree I do that. However, in the course of testing both the Raw option and the backtick Escape Character, I discovered a secret undocumented feature of Hotstrings. In some special cases, it may come in handy for changing Hotstrings on-the-fly.

*          *          * Continue reading

Turn AutoHotkey System Tray Icons into One-Click Action Buttons (AutoHotkey Tip)

Rather Than Using Hotkey Combinations, a Simple Click of the Icon in the Windows System Tray Launches Your App

One of the features I added to the InstantHotkeyArrays.ahk script turns the Windows System Tray AutoHotkey into a one-click button for launching new Instant Hotkeys. The new hot-button made from an existing icon works out well—especially since I can never remember the Hotkey combination for creating a new Instant Hotkey. Continue reading

Beginning Tips for Writing AutoHotkey Scripts

Exploring the Existential Mysteries of AutoHotkey Code and How It’s Often Misunderstood

AutoHotkeyInsightsI’ve just published my latest book, Beginning Tips for Writing AutoHotkey Script, which endeavors to clear up some of the mystery surrounding the way AutoHotkey works. You’ll find grasping how AutoHotkey processes AHK scripts a tremendous help. Quite a bit of the confusion encountered by novice AutoHotkey scriptwriters occurs through misunderstandings about the manner in which everything (life, the universe, and AutoHotkey scripts) fits together. I wrote the book with that muddiness in mind. Continue reading

The AutoHotkey “For Key [, Value] in Expression” Loop for Associative Arrays

The Standard AutoHotkey Loop Command Works Great for Incremental Series, But the For Key [, Value] in Expression Object Loop Offers Unique Flexibility for Associative Arrays

In my last blog, I introduced associative arrays to the InstantHotkeyArrays.ahk script for solving the connection problem between the Instant Hotkey combination and the insertion text. It works brilliantly—although novice AutoHotkey users might experience a slight learning curve.

On the downside of associative arrays, the standard AutoHotkey Loop command may not provide the access you need to all of the array items. Fortunately, AutoHotkey provides a command specifically for use with Objects such as true arrays: For Key [, Value] in Expression.

Continue reading