Auto-Install Data and Text Files Embedded in .AHK Scripts (AutoHotkey Tip)

While the AutoHotkey FileInstall Command Works Great When Packaging External Files inside Compiled EXE Files, You Can Also Package and Extract Data and Text Files with Uncompiled AHK Script Files

coverepub-250In Chapter Six and Chapter Thirty-eight of the book AutoHotkey Applications, I discuss using the FileInstall command when combining various types of support files (e.g. jpg, wav, ini) into one compiled EXE file. Upon loading the app for the first time, a double-click of the left mouse button extracts the embedded files and places each at its proper location on the drive. After downloading an AutoHotkey app, this command alleviates the need to keep track of each external file required by the package. However, the FileInstall command only works for compiled EXE files.

Due to the ever-present risk from computer viruses, it gets harder and harder to send and download EXE files. Both Web and computer security systems give user warnings—if they don’t outright block all EXE files. The safest and easiest way to share AutoHotkey apps is through the text-based .ahk script files which contain only human-readable code. (Users can later compile the script themselves.) If you want to include more files than merely the AutoHotkey script, you can package all the pieces inside a ZIP file for later unzipping. But, if you want to include a text-based data or ReadMe.txt file for the AutoHotkey app which automatically extracts into the working folder, then you can use the following technique—no FileInstall command required.

Continue reading

How to Move a Message Box (MsgBox) Window (AutoHotkey Trick)

Sometimes a MsgBox Window Just Pops Up in the Wrong Place—Here’s How to Relocate It

I’ve experienced this problem a couple of times. I use the MsgBox command to display script information at specific spots in a script. If in the modal mode (always-on-top), the pop-up window obscures my view of the window underneath it. I want the MsgBox to open elsewhere on the screen but AutoHotkey MsgBox command does not provide options for placing the window at an alternative location.

instanthotstring overwrite
The MsgBox command does not allow options for relocating the window on the computer screen.

The WinMove command can relocate the MsgBox window, but only after the window exists.  Since the MsgBox command stops the processing of the current thread, inserting the WinMove command after the MsgBox command doesn’t work. AutoHotkey won’t run the command until after closing the MsgBox window. I need a way to initiate a separate processing thread which relocates the MsgBox window after it comes to life—without closing the MsgBox window. Continue reading

When to Rewrite Your AutoHotkey Scripts

AutoHotkey Scripting Philosophy or Speeding Up the InstantHotstring.ahk script

“Before you can fix a problem you must understand it. Before you can understand a problem you must fix it.”

Sounds like a chicken/egg problem, but I assure you it isn’t. You only begin to understand a problem when you start working on a solution. As you grind through a script, you develop a deep awareness of its inner workings. I encourage any AutoHotkey novice to jump into a new script with both feet—even if you don’t think you know what you’re doing.

Sitting around and speculating about possible answers to a question often serves as mental thumb-twiddling. You must start somewhere—anywhere. Until you actually dig into it and undertake the work, you will never truly comprehend the obstacles and pitfalls associated with implementing a fix. You’ll find this singularly true when writing AutoHotkey scripts— especially as a beginner. The answer to the question “Where do I start?” is “Anywhere!” Continue reading

New Alternative Free AutoHotkey Scripts Download Site

Augmenting the Original Free AutoHotkey Scripts Page, We Now Offer an Alternative Script Index without the EXE Files

Library Benefits

For a couple of reasons, I’ve created a new download page for the free AutoHotkey script on the ComputorEdge Software Showcase site:

  1. Depending upon Windows security settings, some people have trouble downloading ZIP files which include compiled EXE files.
  2. Recent “Denial of Service” attacks have made the site unavailable in certain parts of the world. (For now, I know of one UK reader who has trouble connecting.)

It just makes sense to offer an alternative download site. Continue reading