Encapsulate AutoHotkey Code for Multi-Script Integration and Portability (Scripting Techniques)

Run Your AutoHotkey Scripts as Standalone Apps or Add Them Unaltered to Master Scripts by Creating Hermetically Sealed Auto-Execute Modules

If you’re anything like me, you’ve written a number of scripts which you use regularly. You can run each app separately assuring that they don’t conflict but that tends to load the Windows System Tray with too many icons—making it a little difficult to track all of them.

On the other hand, combining the scripts into a single file presents problems of its own. Any script which contains its own auto-execute section must run this part of the code when it first loads. Simply using the #Include directive won’t do the job. Place it in the top of the file and the other script modules, such as Hotkeys, Hotstrings, and Label subroutines, stop the processing of the original auto-execute section. Yet, if you place the #Include at the bottom, AutoHotkey never sees or runs the new auto-execute section. The novice scriptwriter often solves the problem by breaking apart the script and separately adding the auto-execute section to the top of the master file while locating all the other code modules toward the end of the file.

Continue reading

Advertisements

Using Unique Icons for Specific Windows Shortcuts (AutoHotkey Menu Tip)

Draw Icons for AutoHotkey Menus Directly from Windows Shortcuts

I talked extensively in an earlier blog about adding icons to the menus in the QuickLinks.ahk script by using the FileGetShortcut command. This AutoHotkey command digs out data such as the target program from the shortcut. At the time, I didn’t attempt to use the captured icon data (OutIcon and OutIconNum—icon location and number respectively) because, in most cases, the variables came up blank. Even using the standard context menu creation option (New⇒Shortcut) often did not save the icon data for viewing with GetFileShortcut. Frankly, that would have made the process too easy.

Continue reading

New Version of QuickLinks AutoHotkey Script

Many Changes to QuickLinks.ahk Previously Discussed, Plus a Few New Features Not Yet Covered! Now Available for Download!

I’ve finally posted the latest version of QuickLinks.ahk which includes all of the discussions from the past few weeks—plus a couple more features and fixes which I plan to talk about in the near future. Continue reading

Finding Windows Icons for AutoHotkey Menus (Quick Tip)

A Useful AutoHotkey Script for Quickly Identifying Icons Embedded in Other Windows Files

In the last blog, I demonstrated how to add icons to the QuickLinks.ahk menus. The use of the tiny graphics makes it easier to pick out particular menu options. But, you need to know where to look for icons. Once found, you can easily add an icon to your menus directly from a Windows file (e.g. EXE, DLL, etc) without creating new image files. Continue reading

Spice Up AutoHotkey Menus with Icons (AutoHotkey Tip)

Using the Right Images Make Your AutoHotkey Menus Both Prettier and More Useful

It’s easy enough to put together a plain vanilla AutoHotkey pop-up menu without any icons. The sample QuickLinks script creates a menu from favorites Windows shortcuts in the QuickLinks folder. However, a stripped down menu looks pretty boring and makes individual items harder to find. Continue reading