AutoHotkey Tip of the Week: Use ToolTips to Make Apps User-Friendly—August 26, 2019

Tip: By Applying the OnMessage() Function, You Can Include Windows ToolTip Notes in Your AutoHotkey GUI Window Scripts to Add Hints and/or Instructions Which Pop-up When Mousing-Over the Controls

Light Bulb!People might find some cleverly-designed AutoHotkey scripts confusing. Wouldn’t you like to add hints and tips which explain each control in your AutoHotkey GUI window? You can do just that with the ToolTip command and the OnMessage() function.

coverepub-250In the book AutoHotkey Applications, “Chapter Thirty-four: Pop-up Labels for All Your Programs (ToolTip Command)”, the Tooltip command highlights each control in an AutoHotkey GUI (Graphical User Interface) window. Use the ToolTip command to add helpful little informational notes to your AutoHotkey applications. Once you implement this tip, whenever you hover the mouse cursor over controls in an AutoHotkey GUI, the ToolTip command will identify the control’s function or give instant instructions (as shown below).

(Extra Tip: You can use this same technique with other non-AutoHotkey Windows application by identifying window and control names with Windows Spy or the WindowProbe.ahk script, then writing a short companion AutoHotkey script to work with the Windows program.)

ToolTipHelp
An AutoHotkey GUI shows three different ToolTips as the cursor is moved over each control.

Continue reading

AutoHotkey Tip of the Week: How to Combine Multiple Scripts into One—August 19, 2019

Design Your Scripts to Either Run as Stand-alone Apps or Use the #Include Directive to Integrate into a Master Script without Modification

Light Bulb!Cover 200 Border

The cool thing about this tip is that, after you implement these techniques—without any additional changes—you can run your AutoHotkey script as an independent app or quickly add it to a master script. 

In “Chapter Eleven: How to Write Easy-Merge AutoHotkey Scripts” from the book Beginning Tips for Writing AutoHotkey Scripts, I outline steps for writing scripts which easily combine with other scripts without conflict. This allows the AutoHotkey user to run multiple apps without needing to launch each script individually. (It also prevents the accumulation of numerous AutoHotkey icons in the Windows System Notification Tray.) If you employ these basic design tips when writing your apps you’ll find that you don’t need to do any rewrites when combining useful scripts. Continue reading

AutoHotkey Tip of the Week: IfWinActive Versus #IfWinActive—August 12, 2019

Tip: Isolate Your Hotkeys and Hotstrings to the Appropriate Window

Light Bulb!As beginners, we tend to create universal Hotkeys and Hotstrings which work everywhere. This usually works out in our early scripts, but, eventually, we discover that our key combinations either interfere with particular programs or we begin to run out of easy-to-remember Hotkeys and Hotstrings. To resolve this issue, limit your Hotkeys and Hotstring to working only for those programs where you need them.

hotkeycover200You can create context-sensitive Hotkeys and Hotstring with either the IfWinActive function or command or the #IfWinActive directive. Which you use depends upon what you need to do. The IfWinActive command allows greater flexibility for any set of conditions, while the #IfWinActive directive only works for Hotkeys and Hotstrings.

For more information, see “Chapter Two: Block Windows Shortcuts with AutoHotkey” and “Chapter Three: AutoHotkey #Directives for Context-Sensitive Hotkeys—#IfWinActive” of the book AutoHotkey Hotkey Tips, Tricks, and Techniques, (Chapter Three clears up the confusion between AutoHotkey’s IfWinActive command and the #IfWinActive directive.)

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.)

jack

This post was proofread by Grammarly
(Any other mistakes are all mine.)

(Full disclosure: If you sign up for a free Grammarly account, I get 20¢. I use the spelling/grammar checking service all the time, but, then again, I write a lot more than most people. I recommend Grammarly because it works and it’s free.)

 

Total the Numbers Found in Any Document (AutoHotkey RegEx Tips Part 5)

For a Quick-and-Dirty Calculator, Use Regular Expressions (RegEx) to Pull Numbers from Documents or Web Pages and Total Them Up—Plus, a RegEx for Removing (or Extracting) Numeric IP Addresses

Shifting gears, I end the discussion of the MultiPaste.ahk script which parses copied data into component parts for easier paste operations into other documents. With this blog, I start working on another tool for simplifying a Windows task—addition.

Sometimes I see a list of numbers in either a document or a Web page which I would like to quickly total without loading a separate calculator. For example, the shopping cart program I use for my book sales offers a summary table of all recent sales. While I can use a reports section of the site to get more information (e.g. monthly sales), I want a tool to quickly highlight the desired entries and give me the total of the individual sales. To do that I use a Regular Expression (RegEx) specifically for extracting those sales numbers. Continue reading