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

Adding Startup Folder Shortcuts to a System Tray Menu (AutoHotkey Startup Control)

By Loading the Startup Folder Shortcuts into a Menu, We Can Access the Apps Even When No Icon Appears in the System Tray

Last time (“Collecting File Information from Windows Folders Using AutoHotkey“), I produced a simple MsgBox displaying the Windows shortcuts found in the Startup folder. When Windows launches, it reads and loads the programs or shortcut targets located in that folder. This provides AutoHotkey users an easy method for auto-loading their most-used scripts. However, the more scripts, the more clutter that appears in the System Tray in the form of AutoHotkey icons. You can reduce the crowding by adding the Menu,Tray,NoIcon command line to each script but then you need a technique for quickly reaching those hidden apps.

By inserting the shortcut names into a separate System Tray right-click context menu, you can both generate a list of shortcuts and provide quick access to the scripts. In this barebones AutoHotkey script, I create a menu that opens either the target script in Notepad (.ahk files) or the folder for the program (.exe files).

Continue reading

Collecting File Information from Windows Folders Using AutoHotkey

In Order to Manage Scripts Launched from the Windows Startup Folder, We Must First Know the Folder’s Contents

Last time in “Auto-Loading AutoHotkey Scripts When Booting Windows,” I highlighted the problem introduced by launching scripts from the Windows Startup folder on boot up—too many AutoHotkey icons in the System Tray might overwhelm the status bar. We can turn off the icons, but that’s like turning out the lights in an unlighted, windowless room full of furniture. You don’t know what’s where. We need a handy system for consolidating the information sitting in the Startup folder without making it too intrusive.

This time I demonstrate one technique for consolidating the Startup folder data for display. I have yet to settle on how I want to display the information and use the data. I see a number of possibilities:

  1. A single MsgBox listing the Startup shortcuts—the simplest, yet least flexible approach.
  2. A single System Tray icon right-click menu listing the Startup shortcuts—more flexible but limited in action creating techniques.
  3. A GUI window using a ListView control displaying the Startup folder’s shortcut data—the most flexible and powerful approach but more complicated to implement.
Continue reading

Auto-Loading AutoHotkey Scripts When Booting Windows

Add Shortcuts to Your Windows Startup Folder to Automatically Run Your Most Important Scripts

Every AutoHotkey user keeps a few favorite scripts at hand. Some people put them in one big master AHK file—auto-loading it when Windows boots. Others may use Windows Task Scheduler to initiate the apps. (See the “Windows Task Scheduler to Elevate Script Privileges” section of Chapter 16.1.4 of Jack’s Motley Assortment of AutoHotkey Tips.) Even more, add individual shortcuts to the Windows Startup folder for the preferred scripts. Each method has its advantages and disadvantages. In this blog, I visit AutoHotkey techniques for adding shortcuts to the Windows Startup folder.

Recently, a reader pointed out that the link for the AutoStartupToggle.ahk script at the Free AutoHotkey Scripts page pointed to the wrong script. I repaired the link then took a closer look at the script.

After selecting an AutoHotkey script (.ahk) or compiled app (.exe) in Windows File Explorer, the Ctrl+Win+3 key combination creates a shortcut in the Startup folder—auto-loading the script on bootup. If the matching shortcut exists in the Startup folder, that same Hotkey combination removes it. While this barebones routine works fine, I began considering the implications of using the Startup folder for all my regular scripts. This prompted me to dig deeper into the possibilities.

Continue reading

AutoHotkey Tip of the Week: Alternative AutoHotkey Notices

In Addition to the ToolTip Command, AutoHotkey Offers Other Useful—Although Less Flexible—Message Commands

In my last blog, I suggested several different ways to use the ToolTip command. This time I take a quick look at a couple of other methods for passing information to users. While less flexible than the many of the other informational techniques, the Menu, Tray, Tip command and the TrayTip command each serve a useful purpose:

  1. System Tray Icon ToolTip for adding information about individual running AutoHotkey scripts.
  2. Alternative TrayTip Command for brief Windows notices about script activity.

Depending upon the situation, you may find either of these techniques a useful alternative to ToolTips, SplashText, SplashImages, Progress bars, or the Message Box.

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: Embed Images Directly in the AHK Script

Rather than Use the FileInstall AutoHotkey Command, This Trick Allows You to Lodge Images Directly into Your AutoHotkey Scripts

Light Bulb!In the past, whenever I wanted to add a graphic image to an AutoHotkey script, I needed to either separately provided the file or embed it in the compiled EXE file using the FileInstall command. The AutoHotkey world has opened my eyes to an ancient technique for embedding an image directly in the AHK script—no need to supply the file separately or embed it by compiling the script. Continue reading

Save AutoHotkey Script Settings in Your Windows Registry

While You Can Use an External File to Save Your Script Defaults, You Can Also Call-on the Windows Registry to Store App Settings

In most cases, I’ve used a separate file (text or INI) to save settings. While this works well, it requires the creation and tracking of that independent file. For the script to read the settings, it must know where to locate that file. But, if you want to save script settings without the baggage of that extra file, then consider using your Windows Registry.

You’ll find a few advantages to maintaining your script settings in the Windows Registry:

  1. Unlike a separate settings file, you don’t need to keep track of the Windows Registry’s location—it never moves. Regardless of where you locate your AutoHotkey script on your computer, you will always find its settings in the exact same place.
  2. You won’t accidentally lose your settings by manually deleting what may seem like an extra file in Windows File Explorer.
  3. Your settings remain semi-hidden from public view in a semi-permanent form.

This approach to storing your script defaults deep inside the recesses of Windows adds an air of mystery to your apps—especially if you compile them into EXE files. Continue reading

Recognize Running Scripts with System Tray Icon Techniques (AutoHotkey Tip)

If You Run a Number of AutoHotkey Scripts Simultaneously, Distinguish Each Icon in the Windows System Tray with These Menu Commands

At times, I’ve found that I have six or more AutoHotkey scripts running at the same time. Each one adds the little green icon with an embedded “H” to the Windows System Tray. This gets confusing. I can only tell them apart by hovering the mouse cursor over an icon and reading the script name in the Tooltip pop-up message. Sometimes the Tooltip alone doesn’t do an adequate job. Continue reading