AutoHotkey Tip of the Week: Channeling Text to a Tagged Window

When Collecting Information from Various Sources, Send the Text Directly to an Unseen Text Editing Field

Last time in “Tricks for Tracking and Activating Target Process Windows“, I demonstrated a technique for tagging and tracking a window using its Unique ID. After tagging any window with one Hotkey combination, you can instantly recall it with another. While a pretty cool trick, the question of when would you ever use it arises. This time I offer a practical tool for gathering information from various digital sources (Web pages, documents, e-books, etc.) into one text editor window—without jumping back-and-forth while doing cut-and-paste operations. 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: Word Manipulating Dynamic AutoHotkey Hotstrings

A Mini-Regular Expressions (RegEx) Tutorial Using the RegExHotstrings() Function for Word Swapping and Double Word Auto-Delete

While the RegExHotstrings() function has its limitations (discussed in “Dynamic Regular Expressions (RegEx) for Math Calculating Hotstrings“), we can quickly implement some simple (yet complex) dynamic Hotstrings using a one-line function call. The RegExHotstrings() function offers a few advantages over the traditional Hotstring format. Regular Expressions (RegEx) used in the function bust through the fixed-text limitations of the double-colon format (e.g. ::lol::laugh out loud). RegEx allows you to match string patterns making wildcard text replacements possible. To explain how the RegExHotstrings() function works, I use one-line function calls to replace ambiguous text with targeted results.

RegExHotstrings

In order to make the best use of the RegExHotstrings() function, we need an understanding of the key concepts driving the function. Once we get a hang of how to operate this dynamic Hotstring function, we can analyze the parentheses-enclosed expressions in each example to develop a better grasp of how RegEx works.

In this blog, I highlight two different RegExHotstrings() function word editing operations: one for swapping the order of two errant words; the second for auto-deleting duplicate words. After introducing RegExHotstrings() key concepts, I explain step-by-step how each RegEx behaves.

Continue reading