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

Moving Forward with AutoHotkey Chrome.ahk Tools

My Last Three Blogs Offer a Basic Introduction to Installing and Running the Chrome.ahk Web Page Automation Tools—Find More Resources for these Useful Functions

In my earlier blogs, I posted a beginner’s introduction to GeekDude’s Chrome.ahk Web page automation tools:

I wrote these columns to bridge the gap between the novice-level user and the videos produced by GeekDude and Joe Glines—even causing me to take time to allow the techniques to ferment in my brainpan. While the videos provide excellent information, they assume a certain level of user experience. Hopefully, my blogs provide enough insight to allow new users to:

  1. Develop a basic understanding of how Chrome.ahk functions facilitate the completion of Web forms while highlighting the complications from HTML and Javascript code.
  2. Make a decision about whether they will continue to pursue these Web automation techniques.

After this reference blog, unless someone asks me specific questions about Chrome.ahk, I intend to move on to other topics.

Continue reading

Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 2)

How to Write Javascript Code for Web Page Automation Using AutoHotkey Chrome.ahk Tools—Digging into the Quirks of Javascript

In my last blog (“Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)“), I discussed how to reveal Web page control names in the source code. This time, I explain how to use those control names to write Javascript expressions for inserting data into text fields and activating menu items and buttons.

Javascript Code

HTML code creates the Web page structure—including editing fields, menus, and buttons. We use Javascript commands to initiate action within the static HTML Web. The functions found in Chrome.ahk AutoHotkey tools use Javascript expressions to send commands to the active Web page by channeling those directives through a Chrome debugger channel. You must use Javascript to communicate with the Web page.

Continue reading

Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)

Analyze Web Page HTML Code to Find Control Names and/or IDs for Writing Javascript Expressions for Automating Web Forms Using the Chrome.ahk Library

Logging into online accounts ranks as one of the most common motivations for AutoHotkey users automating Web pages. Using screen-level AutoHotkey Web page automation can get cumbersome. For more reliable and accurate solutions consider source-level automation using the AutoHotkey Chrome.ahk Library of tools. However, before automating any Web forms with these functions, you need to accomplish two tasks:

  1. Analyze the Web page to identify the target HTML controls’ name or id (e.g. text fields, buttons, etc).
  2. Write Javascript action expressions for use with the Chrome.ahk library.

In this blog, I introduce how to identify the controls required to fill in a Web form. In my next blog, I’ll address the more complex task of writing the Javascript expressions for Web page input.

Continue reading

Installing Chrome.ahk AutoHotkey Web Page Automation Tools

Although It Comes with a Bit of a Learning Curve, the Chrome.ahk AutoHotkey Library Offers More Precise Source-Level Web Page Automation

(Updated November 5, 2020) Last time, I highlighted the limited techniques available for automating Web pages at the screen-level. The Web browser insulates the user from the underlying HTML and Javascript page code preventing the use of control names for automating Web pages.

This time, I introduce source-level Web page automation running a short test script after installing a set of Google Chrome AutoHotkey source-level Web page automation tools—Geekdude’s Chrome.ahk Library. I’ve set up a test page called “Jack’s AutoHotkey Chrome Test Page” for a quick trial of the tools. (When initially viewing the test Web page, you should see a set of three empty input fields: First Name, Last Name, and Street Address.) In this blog, I discuss how to install and set up the Chrome.ahk tools—then access the setup by running a sample AutoHotkey script that automatically fills in the three input fields:

The test script inserts data into the three input fields, then displays a Chrome message box displaying, “Hello World!”

If you can get this test script running with your Chrome browser, then a totally new world of Web page automation opens up.

Continue reading

Automating Web Pages with AutoHotkey

When Automating Tasks, Browser Web Pages Present Special Problems

Due to the nature of the Internet and the function of Web browsers, AutoHotkey users encounter particular issues when automating Web pages. AutoHotkey GUIs (Graphical User Interfaces) and many older Windows programs allow direct access to controls for automation. Newer apps tend to use ribbon menus which usually include accessible Alt+key shortcuts. However, Web browsers contain built-in protections which insulate users and make controlling operations more opaque. The average Web surfer only has access to what appears on the screen. Getting to the inner workings of Web browsers requires special tools.

After receiving a request from a Web browser, the Web server sends code consisting of HTML and JavaScript to that Web browser. The Web browser interprets the code and sends the results to the computer screen in the form of text, images, links, and controls. The Web browser sends back any user actions requiring server action.
Continue reading

Create Instant Windows Gadgets Using AutoHotkey Graphical User Pop-ups (GUIs)

One of the Easiest and Quickest Means for Building a Short, Useful PC App Takes Advantage of AutoHotkey GUI Controls—A Review for the Novice Scriptwriter

Many of my sample scripts available at the Free ComputorEdge AutoHotkey Scripts page use the built-in Graphical User Interface (GUI) tools available in the Windows operating system. Taking advantage of these Windows mechanisms demonstrate only one of the many reasons why the free AutoHotkey scripting language affords so much power. With a few lines of code, you can build Windows gizmos for an innumerable variety of applications. The GUI pop-up acts as the primary core for many AutoHotkey scripts. Easy-to-use and only requiring a minimum amount of programming, the GUI makes possible Windows gadgets for almost any use.

While almost all of my books discuss how to use GUIs in a number of different ways, the book AutoHotkey Applications: Ideas and Tips for Writing Practical AutoHotkey Scripts spends a great deal of time discussing various AutoHotkey Graphical User Interface (GUI) pop-ups with example scripts.

Continue reading

Fixing AutoHotkey Web Lookup Scripts

If a Web Page Changes Format, the Data-Extracting Regular Expressions (RegEx) May Need Updating—Fixing the SynonymLookup.ahk Script

When writing a blog, I tend to use certain words over and over again. While rereading early versions, these redundant words jump out at me. Not only do they point out my limited vocabulary, but the repetitions tend to render my blogs a little more starchy and boring. That’s why I often resort to my always-loaded SynonymLookup.ahk script. This app saves time while making me look a little smarter.

The current version of SynonymLookup.ahk script lists more possibilities and marks antonyms (most of the time) with a caution sign (). (Click image for expanded view.)

After I discover a duplicated word, I highlight it, then hit the Ctrl+Alt+L Hotkey combination. A menu of possible replacements pops up. I click on the one that best fits my intent and the new term immediately displaces the original text. I habitually use this script.

When the SynonymLookup.ahk Script Breaks

Over the life of the script, I’ve encountered the menu shown at right a couple of times. This menu pops up whenever the script downloads and scans the source code 10 times without getting a RegEx hit—usually the result of code changes made by the source page Webmaster.

Continue reading