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

New Hotkey Book! (AutoHotkey Tips and Tricks)

AutoHotkey Techniques and Best Practices E-Book for Automating Your Windows Computers with Hotkey Combinations—Includes Something for Everyone!

Whether you’re a noobie to AutoHotkey scripts or an advanced programmer, of all my books, AutoHotkey Hotkeys may be the most important for new little-known tricks and useful ideas. It’s not that the other books don’t cover significant features of AutoHotkey, but this book includes some of the most practical tips for adding power to your scripts. I didn’t plan it that way. Continue reading

Force an Expression (%) in AutoHotkey for More Powerful Commands (Beginning Hotkeys Part 17)

Learn the Secret of Adding Power and Flexibility to AutoHotkey Commands—Use Forced Expressions to Tailor Almost Anything

Four years ago I wrote my first AutoHotkey article as part of a Windows column for ComputorEdge Magazine. (One of my readers introduced me to AutoHotkey.) The more I dug into the scripting language, the more I understood how, with very little effort, it could help virtually any Windows user. I took the path of studying the AutoHotkey online documentation, searching AutoHotkey forums for ideas and techniques, testing various ways to write the code, then chronicling my insights in what eventually became first a number of articles and blogs, then (mostly beginning) books. Continue reading

AutoHotkey Script for Precision Hotkey Mouse Movement in Windows Graphics Programs—Continued (Beginning Hotkeys Part 16)

This Short AutoHotkey App Adds Pixel Level Precision to Mouse Cursor Movement in Any Windows Graphics Program.

This time we add more cursor directions by implementing numeric keypad Hotkey Scan Codes, plus a feature for temporarily adding these micro cursor hotkeys to any new graphics app.

Continue reading

When to Use Virtual Keys and Keyboard Scan Codes with AutoHotkey (Beginning Hotkeys Part 14)

Add Missing Keys or Take Advantage of Extra Keyboard Keys with AutoHotkey Scan Codes and Virtual Keys

In preparation for this blog I tested numerous different Hotkey configurations with Virtual Keys and/or keyboard Scan Codes. To say the least, knowing when to use what gets pretty confusing. While many setups might not work, there are multiple other configurations which do the same thing. For that reason, before digging into any details, I’m offering a summary set of thumb rules for figuring out when you might want to use either of these special key codes. (See this previous blog to review Virtual Keys and Scan Codes.)

Continue reading

AutoHotkey Scan Codes, Speech, Sound, and Splash Images in Children’s Apps (Beginning Hotkeys Part 13)

Write Toddler Educational Hotkey Scripts by Combining AutoHotkey Scan Codes, the SoundPlay Command, the SplashImage Command, and ComObjectCreate() for Speech

I started digging deeper into the weeds of identifying and using AutoHotkey Scan Codes and Virtual Key Codes (introduced last time), when I decided to take a diversion into a little fun, but practical approach to using Scan Codes for educational programs. Sink your AutoHotkey scripting teeth into this educational example. It covers a simple approach for teaching little ones keyboard numbers and letters by combining Hotkey techniques from earlier blogs, plus speech, sound, and SplashImages from chapters in the AutoHotkey Applications book.

Continue reading

Understanding AutoHotkey Keyboard Scan Codes and Virtual Key Codes (Beginning Hotkeys Part 12)

Learn the Difference Between AutoHotkey Keyboard Scan Codes (SCnnn) and Virtual Key Codes (VKnn) and When to Use Them for Hotkeys

Not all keyboards are equal. Detached desktop keyboards may include many extra keys while smaller laptop keyboards might be shortened versions of their larger cousins. When setting up Hotkeys, you must work with the keyboard you own. That means using the available keys and the usual AutoHotkey key names and techniques. However, you will likely find key action names in the AutoHotkey Key List with no corresponding key on your particular keyboard (e.g. AppsKey). At other times, you may find keys on your keyboard which don’t appear in the AutoHotkey list. These situations may call for a unique approach to setting up Hotkeys.

Continue reading