Techniques for Swapping Words Using the StringSplit AutoHotkey Command; ErrorLevel for Producing Alternative Results; a Glance at a Regular Expression (RegEx) for Swapping Words
In the last blog, we looked at a quick Hotkey for swapping mistyped letters in any Windows document or text editing field. Just place the text cursor between the two letters and hit ALT+R. The characters reverse positions. This time the technique is expanded and refined for swapping two words.
Delving into Windows Clipboard Hotkey Tricks for Switching Mistyped Letters in Any Document or Text Editor…Plus, a Discussion of the “Standard AutoHotkey Windows Clipboard Routine”
Note: January 29, 2017—Over time, I’ve come to realize that AutoHotkey scripts should employ a number of different “best practices” in Clipboard manipulation routines. The code includes ClipboardAll, ClipWait 0, and IfErrorLevel. This blog discusses those techniques in detail. I now refer to this AutoHotkey Clipboard setup as “the standard AutoHotkey Clipboard routine.”
I’m taking yet another diversion from the Hotkey command to dig into something just as important (if not more so) when discussing Hotkeys—the action code contained in and initiated by the keyboard combination. Highlighting Hotkeys without looking into the embedded routines is like studying eggshells without learning the nature of the egg. While the various techniques for implementing Hotkeys are significant, looking at the specific AutoHotkey action routine inside may be even more crucial. Continue reading →
Using the Hotkey Command to Toggle Hotkeys On and Off
There are a number of reasons why you may want to turn Hotkey combinations off (and on again)—at least temporarily. That is one of the primary uses for the Hotkey command since once a Hotkey is set up with the standard double-colon format, there is no other way to turn it off—short of suspending all the Hotkeys in the script (right-click on the AHK script icon in the Windows Systems Tray and select “Suspend Hotkeys” from the menu).
Standardizing Hotkeys for Deleting Entire Words or Line Segments in Any Windows Program or Web Editing Window
As a diversion from the previous discussions about the Hotkey command (which will continue next time with when and how to toggle Hotkeys on and off), I’m digging into the concept of standardizing keyboard shortcuts throughout all Windows applications with AutoHotkey. This break in direction includes practical editing examples for deleting whole words and line segments with simple common shortcuts. You can immediately implement these editorial Hotkeys in your regular scripts.
The AutoHotkey #If Expression Directive and Hotkey, If (Expression) Command Make Hotkeys Expression-Sensitive, Plus a Simple No-Click Volume Control Script
The AutoHotkey documentation for the #If expression directive includes a short script at the bottom of the page which is perfect for demonstrating how to use the Hotkey, If (Expression) command and its interdependence on the #If expression directive. It’s a cool little app because it reduces Windows volume control to simply scrolling the mouse wheel up or down while hovering the mouse cursor over the Windows taskbar—no click required!
* * *
This beginning Hotkey blog builds upon the discussions in the previous parts. If you find any of the information too confusing, then reviewing earlier blogs may be worthwhile.
The Hotkey Command Adds Immense Flexibility to AutoHotkey Scripts, But You Should Know How and When to Use It!
As I review the Hotkey command for my upcoming explorations, I note that it offers many capabilities which add flexibility and power to Hotkeys (and in some cases to Hotstrings). The advantage to the Hotkey instruction is that unlike the basic double-colon Hotkey definition (!#^h::command) which gets defined in the first phase of AutoHotkey file processing, it can run at any later time—either while loading in the auto-execute section or after the file loads in any subroutine or function.