AutoHotkey Tip of the Week: ToolTip Command Tricks

See What You Can Do with the AutoHotkey ToolTip Pop-up!

AutoHotkey AutoHotkey Library Deal!

The ToolTip command acts as a conduit for communication between an AutoHotkey script and its user. Similar in function to other visual information tools (the SplashText command, discussed in a previous blog,  and the Progress/SplashImage command used in the InstantHotstring.ahk script), the more compact ToolTip follows the mouse cursor by default, rather than planting itself in the middle of the screen. You can use the tiny pop-up window in several different ways:

  1. Action Complete ToolTip
  2. Toggle Status Tooltip
  3. Reminder ToolTip
  4. Realtime Informational ToolTip
  5. Instructional ToolTip
  6. Multiple ToolTips
Continue reading

AutoHotkey Tip of the Week: Using SplashText for Peace of Mind

Sometimes We Wonder If Our Hotkeys Work At All—The SplashText Command Tells Us That at Least It’s Trying

Note: I accidentally published this blog with the May 25, 2020 date when it should have been June 1, 2020. Trying to fix it only causes more problems, so I’ll leave it as is.

SplashText tells you about an AutoHotkey routine in progress.
SplashText tells the user about an AutoHotkey routine in progress.

I have a bad habit of leaving multiple programs and browser tabs open. Eventually, Windows gets confused and starts slowing things down. When this happens I sometimes wonder if my Hotkeys work. I execute one then sit and wait.

I know that I keep too many windows (and Chrome tabs) open and don’t reboot my computer often enough. This inevitably leads to computer lag. That means even the fastest Hotkey routines can slow down. When I hit a Hotkey and nothing immediate materializes, I wonder if the routine started at all. By adding the SplashText command to my Hotkey routines, at a minimum, I see that the process has gotten underway—even if I need to wait for the result.

Continue reading

AutoHotkey Tip of the Week: Cramming a Multitude of Controls into a GUI

AutoHotkey GUI (Graphical User Interface) Controls Gives Us Powerful Tools for Building Apps, But Sometimes We Need to Get Creative to Solve the Space Problem

WebPageLinks

My book AutoHotkey Applications: Ideas and Tips for Writing Practical AutoHotkey Scripts introduces the various GUI (Graphical User Interface) Controls available in the Windows operating system. I offer practical examples of how you can use single controls in a script. Yet each GUI control comes with its own particular limitations. Sometimes it takes a combination of techniques to get the full benefit from a unique control feature.

For example, you may find it a challenge to pack a multitude of items into a single GUI without expanding it beyond the screen. Many controls such as an Edit and ListView control allow you to limit the size of the control—then add scrollbars when the volume exceeds the confines of the space. Not so for AutoHotkey GUI Link controls.

In my last blog, “Cull Web Links from a Web Page and Activate Each in a Pop-up GUI“, I built a GUI pop-up window listing the external links scraped from a Web page (WebLinkFindURL.ahk script). In some cases, the number of links far exceeded the space allowed on my computer screen. Since the GUI Link control does not support scrollbars, I added Tab controls to expand the available GUI space without overwhelming the screen. Continue reading

AutoHotkey Tip of the Week: Capture Web Page Addresses (URLs)

When Browsing the Web This Special Function Copies the Page URL without Any Extra Effort

Normally, you can find a Web page address in the URL bar at the top of the browser. Click in that address field and copy it with CTRL+C. That simple act may make the subject of this blog look redundant. However, when applied to last week’s CopyRegTagWin.ahk script, the GetActiveBrowserURL() function can save numerous keystrokes.

By using the user-defined GetActiveBrowserURL() function, a modified version of the CopyRefTagWin.ahk script can include both the title of the source window and, if from a Web page, its URL. If collecting data for research, this feature makes reconstructing sources much easier—without any extra effort. Continue reading

AutoHotkey Tip of the Week: Tricks for Tracking and Activating Target Process Windows

When Implementing Various AutoHotkey Techniques Sometimes We Need to Find Our Way Back to the Proper Window

Most AutoHotkey applications don’t require complicated tracking of process windows. Hotstrings, Hotkeys, and most other techniques do their work in the currently active window. Generally, menus and GUIs automatically return to the original on-top location once they close. However, occasionally circumstances force us to move to other apps or tools—deactivating the current window—before returning to the original target. AutoHotkey offers a couple of techniques for getting back to the right spot on our Windows Desktop.

piechartcartoonFor example, the MousePrecise.ahk app (for precision movement of the mouse cursor) allows users to temporarily enable the mouse accuracy tool in new windows with either a Hotkey combination or a right-click selection from the Windows System Tray icon menu. Since the Hotkey doesn’t change window focus, it works fine, but the act of selecting an item from the System Tray icon menu deactivates the original window. Therefore, before AutoHotkey can include the new app in the active group, it must refocus on that process window and capture its title. Continue reading

AutoHotkey Tip of the Week: Repeat Words and Phrases with RegEx Hotstrings

Save Time with This RegEx Hotstring for Inserting Repeated Words or Sentences—”Blah!” Instantly Turns Into  “Blah! Blah! Blah!”

regexrobotcartoonAt the end of my last blog, I postulated the possibility of a word duplicating RegEx Hotstring. While I don’t know how many people would ever use it, I do remember a time when the technique would have come in handy (as shown in the cartoon on the left). I thought that I would leave the problem as a reader’s challenge and move on, but I found that I couldn’t just abandon the loose end.

While this trick may not embody the most essential Hotstring, the technique might stimulate other AutoHotkey users to venture forward with their own variations on RegEx Hotstrings. I would love to hear about other innovative applications of the RegExHotstring() function—doing things that prove difficult (or impossible) with either traditional double-colon Hotstrings or the built-in Hotstring() function. Continue reading

AutoHotkey Tip of the Week: Dynamic Regular Expressions (RegEx) for Math Calculating Hotstrings

An AutoHotkey Classic, the Dynamic Hotstrings() Function Makes Instant RegEx Replacements Possible—Now, You Can Do Math with Your Hotstrings!

Anyone who reads my blog on a routine basis knows how I love Regular Expressions (RegEx). They make feasible all kinds of capabilities not practical by any other method. While not necessarily easy for a beginner to grasp, RegEx provides a mechanism for matching text when you don’t know exactly which characters you need (wildcards). (That’s why I wrote the book A Beginner’s Guide to Using Regular Expressions in AutoHotkey.) Although you may encounter a bit of a learning curve, RegEx gives you the ability to accomplish some pretty fancy tasks. This time I plan to demonstrate a couple of Hotstring techniques that might amaze you—they did me! Continue reading

Quick Tip: Using the Sleep Command with Clipboard Routines

Use the Sleep Command to Debug Intermittent Routines

tipsLast night, I received the following comment from Thom Blake about last week’s blog “Auto-Capitalize the First Letter of Sentences” prompting this Quick Tip about adding the Sleep command at critical points in certain types of AutoHotkey routines:

Jack

Great script but I seem to have a problem with the capitalize a word function. It only works intermittently. The message box says “No text selected!” when clearly there is.

Thanks, Thom!

This is a needed reminder about a common problem when using the Send command with the Clipboard routine. Sometimes, for whatever reason, certain commands execute before the completion of the last action. In this case, AutoHotkey attempts to copy text to the Windows Clipboard before the SendInput text selection action completes: Continue reading

AutoHotkey Tip of the Week: Auto-Capitalize the First Letter of Sentences

Some People Don’t Find It Easy to Shift to Uppercase While Capitalizing Words—AutoHotkey Allows Us to Stop Reaching for the Shift Key—at Least for New Sentences!

I received the following question from a reader:

Hello,

Is there a script to auto-capitalize the first word of a sentence. Or after a period?

Thanks.

*          *          *

Not everyone received an A in typing class—I didn’t. Plus, many people for a variety of reasons may find navigating a keyboard difficult. Where using the Shift key may be a simple inconvenience for some, people who are not blessed with full functioning fingers and/or hands encounter an arduous task. Even capitalizing the word “I” (“i think i will go”) can present a challenge. The primary goal of AutoHotkey is to make your Windows life easier. Continue reading

AutoHotkey Tip of The Week: Evaluating Deprecated AutoHotkey Commands

As Time Passes, You May Notice More and More Deprecated AutoHotkey Commands in the Online Documentation—When Should You Rewrite Your Scripts and When Should You Ignore the Changes?

While working on the latest version of the QuickLinks.ahk script, I saw that the syntax for the Loop (files & folders) command for the reading the names of directories and files had changed in the online AutoHotkey documentation. (It’s about time that I noticed since it changed back in 2015.) In the original program I used:

Loop, C:\Users\%A_UserName%\QuickLinks\*.*, 2 , 0

and

Loop, %A_LoopFileFullPath%\*.*, 1 , 0

The powers-that-be deprecated that form of the command substituting:

Loop, Files, C:\Users\%A_UserName%\QuickLinks\*.*, D

and

Loop, Files, %A_LoopFileFullPath%\*.*, FD

While the new syntax seems a little clearer, it appears to act in the same manner as the original (still operational) form of the command. A person may ask, “Why the change the command at all?” Continue reading