Brute Force Data-Set Copy-and-Paste (AutoHotkey Clipboard Technique)

I Prefer an Eloquent Solution for Data-Set Transfer Problems, But Sometimes It’s Just Easier to Build a Simple (and More Universal) Copy-and-Paste Tool

*          *          *

I originally wrote the short script discussed in this blog to solve a single data transfer problem. Only after making the script functional did I realized that it could work in numerous different types of data-set transfer environments such as spreadsheets, Web tables, and many other information lists. This AutoHotkey script offers a little less tedious solution to common Windows cut-and-paste problems.

*          *          *

If I need to copy a single section of text into another document, then the Windows Clipboard works find. However, whenever I want to do something more complicated such as moving that same text into multiple data fields or copying data from a table in a document (or on the Web) before transferring it, using the Windows Clipboard can turn into a real hassle. Continue reading

Username and Password Protection in AutoHotkey

While You Won’t Find Absolute Password Protection, There Are a Number of Techniques Available to Help Hide Your Secrets

Computer security is one of the major issues of these times. How do we protect our data? Even after all of the latest innovations in cybersecurity, we hear about hacks of major sites and institutions. With all the ways we use today’s computers, we want to feel as safe as possible.

Caution: Human error (e.g. opening the wrong attachment, not changing passwords, etc.) offers the number one opportunity for the bad guys to invade your privacy. If someone gains access to your computer, then you have virtually no protection. Some people either don’t add a password to their Windows computer or allow autologin when the machine boots up. That’s a mistake! Always require password login to access your Windows computer. Otherwise, you make it too easy for people who stumble upon your computer—either in your office or cyberspace. Continue reading

E-mail the Daily Horoscope to Yourself (AutoHotkey Trick)

Combining the Daily Horoscope from the Web with this AutoHotkey E-mail Sending Technique Makes It Possible to Deliver the Prescription to Anyone

In recent blogs, I discussed how to extract data from a Web page (“Quick and Dirty Web Data Extraction Script“) and send an e-mail directly from an AutoHotkey script (“How to Send E-mail Directly from an AutoHotkey Script“). This time I put them both together to demonstrate how to deliver a daily horoscope to yourself (or a friend).

HoroscopeEmail.pngE-mail—the oldest and most universal method for reaching people—offers a major advantage over text messages and other digital forms of communications (e.g. Twitter, Facebook). Most people own at least one e-mail address which they can access from any of their computers (PC, Mac, or Linux), any smartphone (iPhone or Android), or tablet. To send an e-mail, you don’t need to know a phone number or the type of device. E-mail servers push the message directly to the target addressee. Plus, using AutoHotkey, you can automate the periodic sending of an e-mail. Continue reading

How to Send E-mail Directly from an AutoHotkey Script

Using Windows CDO COM, You Can Send E-mail Without Opening Your E-mail Program

RobotEmailCartoonIn my last blog, I wrote a short script for extracting data from a Web page without using a Web browser (“Quick and Dirty Web Data Extraction Script“). As a demonstration, I showed how to quickly download and cull a daily horoscope from an astrology site for display in a MsgBox window. It occurred to me that rather than using a Hotkey each time I wanted to view my horoscope, I would prefer to receive it each morning in an e-mail. That way I could set up the script to run automatically and push the data to me at the same time every day. Plus, I can view an e-mail on any device (e.g. smartphone, tablet, or non-Windows computer) without any special programming. This requires sending an e-mail via an AutoHotkey script. Continue reading

Quick and Dirty Web Data Extraction Script (An Easy AutoHotkey RegEx Trick)

A Simple Regular Expression (RegEx) Retrieves Your Daily Horoscope by Harvesting Data from a Web Page—This 10-Line AutoHotkey Script Demonstrates How to Build Your Own Web-Based Pop-ups

Regular Expressions (RegEx) can get pretty complicated, but for this desktop trick, you only need to learn one short wildcard expression. Anyone can implement this simple pop-up window trick—displaying virtually any selected data found on the Web without loading a browser. Perhaps you would like a message box displaying the current weather. Or, maybe you want to read your daily horoscope. If it’s on the Web, then you can probably turn it into a quick AutoHotkey app.

As a demonstration (and possible template for other pop-up apps), I’ve written a short script which, without a browser, accesses an astrology Web page and displays my daily horoscope in a Windows message box. You can find the code for this Horoscope.ahk script at the end of this blog.

Continue reading

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