AutoHotkey Tip of the Week: Quick and Dirty Printing—September 30, 2019

If You Need a Hardcopy, Then You Can Use this AutoHotkey Print Technique—Plus a Cheap Way to Get Printer Ink

Library Benefits

Every once in a while you want to put something on paper. Most often, you open the appropriate program (i.e. a text editor or word processor for text documents, PDF viewer for PDFs, or graphics program for images) and print from that application. Trying to use AutoHotkey for direct printing can get pretty complicated (as discussed in Section 10.1.1 “Printing with AutoHotkey Made Simple” of the book Jack’s Motley Assortment of AutoHotkey Tips). But, for a quick printout, you can write an AutoHotkey line of code which sends a document to the printer from a program—without first opening the app.

Continue reading

Open and Print Files with the QuickLinks App (AutoHotkey Tip from a Reader)

Khanh Ngo Offers an Improvement to the QuickLinks.ahk Script Which Enables the Loading of Any Selected File with Your Favorite Program, Plus QuickLinks Can Now Print Files!

Recently I received the following message:

Hi, Jack,

Library Benefits

I just found your website when searching around for AHK tips and found your QuickLinks—very impressive, with minimal coding needed.

I’m currently making good use of it and added a small improvement to QL_MenuHandler that I think you might appreciate too:

When executing a shortcut, send currently selected files as an argument to that program. Basically, open the selected file with the QuickLinks program.

This is quite convenient when opening a text or image editor.

Let me know what you think.

Khanh

After reviewing the changes to the QuickLinks.ahk script, I saw that with the short piece of code, Khanh had greatly expanded the possibilities. What started out as a tool for quickly opening favorite programs and Web pages turned into a method for opening any file with those same preferred applications. I immediately incorporated the new code in the current download. Continue reading

Stuffing More into AutoHotkey Pop-up Menus (AutoHotkey Tip)

Rather Than Increasing the Length of a System Tray Menu, Add Submenus—Plus, How to Use Menu Names (A_ThisMenu) for Conditional Actions

cheeseburgerrecipeWhen I decided to add two more recipes to the cheeseburgerwhiteicon Jack Stuffed Cheeseburger script, I ran into the problem of adding too many items (one for each step in each recipe) to the System Tray right-click menu. In the original, Cheeseburger.ahk script, I only included four steps in the menu (Ingredients, Prepare, Cook, and Serve). However, after inserting the Animal-Style Cheeseburger and the Jack Stuffed Cheeseburger (Animal Style) into the script, the number of recipe increments jumped from four to 18—plus an additional Print Recipe option for each burger. Also, since many of the steps use the same (or similar names), I needed a method for identifying each step with the proper recipe. When increasing the number of AutoHotkey menu options, cumbersome lists of items commonly crop up. You can fix these bloated menus by using submenus. Continue reading

Create a Universal MsgBox Print Function with ControlGetText (AutoHotkey Tip)

When Nothing Else Works for Copying Text, Try the ControlGetText Command and Create a Global MsgBox Print Function

In a previous blog, I highlighted the Control, EditPaste command. The command helped me solve a particular problem where the standard Send, ^v (Windows paste shortcut) responded too slowly. I’ve since discovered that the complementary ControlGetText command resolves some sticky MsgBox printing troubles. It not only works quicker than the Windows copy shortcut (Send, ^c) but it greatly reduces code. Continue reading

Printing with AutoHotkey Made Simple (AutoHotkey Tip)

While Other Techniques Exist for Printing Directly from AutoHotkey, Make It Easy by Using Print Drivers from Other Programs

When I first considered printing from the cheeseburger recipe script, I didn’t realize how complicated printing from AutoHotkey can get. With any printing, a number of factors come into play. First, each printer model uses particular print drivers. Second, the format of the document affects the output and drivers. Third, you may need to choose from multiple printers. Continue reading