A Trick for Creating a New Hotkey from a Subroutine (AutoHotkey Quick Tip)

Use the GoTo Command to Turn the Subroutine for Reading AHK File Notes into a Hotkey for Peeking into Any File Selected in Windows File Explorer

Last time in my “Peeking at Notes Inside Auto-Startup AHK Script Files (AutoHotkey Startup Control)” blog, I discussed the feature in the AutoStartupControl.ahk script for reading and displaying notes from a .ahk source file. The ScriptNotes subroutine uses the data in the Startup folder shortcut to locate the file, then parses out the first set of notes for display. This creates a quick reminder for the purpose and operation of the AutoHotkey scripts automatically loaded when Windows boots.

While a handy tool for the AutoStartupControl.ahk script, the subroutine would offer even more value if I could select any .ahk file in Windows File Explorer and read its notes. For that expanded capability, I need a new Hotkey combination that bypasses reading the Startup folder shortcut and directly accesses the file selected in the Explorer window.

Continue reading

Regular Expressions (RegEx) for Mining Text in Files (AutoHotkey Startup Control)

When It Comes to Extracting Data from Text Files, Nothing Works Like Regular Expressions (RegEx)

Last time, “Peeking at Notes Inside Auto-Startup AHK Script Files,” I added a feature for reading notes inside the .ahk files targeted by shortcuts launched from the Windows Startup folder to the AutoStartupControl.ahk script. This gave me a method for reminding myself how the various auto-startup scripts work. In that blog, I discussed how to find the .ahk file containing the notes. This time, I take a look at how to use Regular Expressions (RegEx) to extract the script notes.

Anyone who follows my blog or reads my books knows that I have a fondness for Regular Expressions (RegEx). The averages person may not find the RegEx system easy to follow or implement, but once the concept clicks, it makes certain aspects of programming much easier—regardless of the programming language. (That’s why I wrote the book A Beginner’s Guide to Using Regular Expressions in AutoHotkey.) When confronted with extracting text or implementing complex replacements, I immediately gravitate toward RegEx. When implemented in scripts such as IPFind.ahk and SynonymLookup.ahk, these enigmatic expressions have made my AutoHotkey life much easier.

Continue reading

Peeking at Notes Inside Auto-Startup AHK Script Files (AutoHotkey Startup Control)

We Can Track Numerous AutoHotkey Scripts Added to the Startup Folder, But Can We Remember How They All Work? Add a Peek Capability to the Auto-Startup Menu as an App Reminder

With so many different AutoHotkey scripts running, the problem of remembering how they all work arises. I may know that I have an app running but not recall the Hotkey combinations needed to access its features. Each new app creates a new set of memory challenges.

I could write one huge help message, but keeping it up-to-date turns into an unwieldy problem. I need a method for quickly peeking at an apps notes without forcing myself to open the .ahk file.

To accomplish this feat, the new ScriptNotes subroutine in the AutoStartupControl.ahk script must:

  1. Load the shortcut’s target file into a variable.
  2. Extract the script notes from that variable.
  3. Display the extracted notes in a pop-up MsgBox.
Continue reading

Add Submenus to the Auto-Startup Menu to Increase Options (AutoHotkey Startup Control)

Submenus Allow AutoHotkey Users to Add Features to Apps Without Needing More Screen Space

Last time in “Adding Startup Folder Shortcuts to a System Tray Menu,” I inserted the Startup folder shortcuts into a System Tray right-click menu. This gave me a method for quickly accessing an auto-load script even when it doesn’t display an icon in the System Tray.

A click of the menu item either opens the script (.ahk) in Notepad or opens the target folder for a compiled executable (.exe) file. While the original menu does the basic job of keeping track of the auto-startup scripts, it only executes one action—opening a script or folder. To expand the capabilities of the Startup Control, we need to add submenus.

Continue reading