Reader Uses Menu Shortcut Keys to Speedup QuickLinks.ahk Action
Alan posted the following comment on Pressing GUI Buttons with a Single Keystroke (AutoHotkey Tip):
Thanks for making such useful contributions to AHK.
I found QuickLinks to be useful but then was looking to make it even more helpful by having key shortcuts. I figured out how to do it! You can let others know if you can point out adding an ampersand in front of the letter of the folder or shortcut.
* * *
I’m gratified that a number of people are using and modifying the QuickLinks.ahk script. It’s evolved considerably since I first introduce the barebones version in the book Digging Deeper Into AutoHotkey. In AutoHotkey Applications, I added icons using the Menu,…,Icon, command. In my most recent Motley Assortment of AutoHotkey Tips, I modified the script to add a number of other features. More recently, I wrote a blog which highlighted changes increasing the power of the script by another reader, “Open and Print Files with the QuickLinks App (AutoHotkey Tip from a Reader)“. In all that time, I never thought to talk about using the single-key shortcut menu technique available in all Windows menus with the QuickLinks.ahk script.
Unless typing text, I tend to use my mouse for just about everything. Since I open QuickLinks with an XButton1 mouse click, moving to the keyboard doesn’t make sense to me. However, if you already use one of the Hotkey combinations (originally Win+Z for the left hand and Alt+, for the right hand) to open the menu structure, then single-letter menu shortcuts make perfect sense.
The beauty of the QuickLinks.ahk script lies in the fact that almost all the required data sits in the Windows File Explorer folders and shortcuts. Rather than make changes to the QuickLinks.ahk script, you only need to add the appropriate single-key shortcut symbol (the ampersand &) into the name of your Windows shortcuts in the Windows folders.
Note: A couple of people have recommended “Quick Access Popup” to me as a replacement for my QuickLinks.ahk script. I have no doubt that it offers way more features with less effort than anything I’ve written. I encourage people to use whichever applications work for them. However, my suggesting a no-programming-required app to replace QuickLinks.ahk would miss the point—at least, my point. I aim to teach the willing how to build scripts that make their computer run faster and better while helping them develop the skills to create more of the tools that they want for their Windows system. Ready-made scripts give you the fish you want, but they don’t teach you how to fish.
Adding Single-Key Shortcuts to Menus
As discussed in the AutoHotkey Menu command documentation for the MenuItemName parameter, you can make the menu respond to a pressed key by placing an ampersand (&) in front of the desired letter. Add this feature to QuickLinks by opening the default folders (for me C:\Users\Jack\QuickLinks) in Windows File Explorer. (If running QuickLinks, select Edit QuickLinks from the top-level menu.) Slowly click twice on the folder or shortcut name (or right-click and select Rename) to enter the edit mode for the folder or file name. Insert an ampersand in front of your planned shortcut key letter.
You should take into consideration a couple of menu behaviors when making these ampersand placement decisions:
- Do not use the same key twice in the same menu. If duplicates occur, only the first activates. (You can use the same key in different menus or submenus.)
- If you want QuickLinks menus to stay in alphabetical order, then don’t place the ampersand at the beginning (as shown above) of the entire name (unless you do the same for every folder/file in the list). A leading ampersand will cause the menu item to jump to the beginning of the list, even though, it only appears as an underlined letter in the menu structure.
Reload QuickLinks for the changes to take effect.
Use Keyboard Shortcuts in QuickLinks
After reloading, the ampersands in the menu item names cause the subsequent letter to appear underlined—acting as an instant single-key shortcut. In my example below, I added the letter t as a Tools menu shortcut and c as the Calculator shortcut.
After opening the QuickLinks pop-up menu, I press t followed by c to launch the Windows Calculator.
You can do this with almost all of your menu items without any changes to the QuickLinks.ahk script. One notable exception includes the Windows Tools item, “Add Secret Windows Tools (God Mode) to QuickLinks Menu”—discussed in the Motley Assortment of AutoHotkey Tips book. You’ll need to add that ampersand to the proper line of code in the script.
Click the Follow button at the top of the sidebar on the right of this page for e-mail notification of new blogs. (If you’re reading this on a tablet or your phone, then you must scroll all the way to the end of the blog—pass any comments—to find the Follow button.)
This post was proofread by Grammarly
(Any other mistakes are all mine.)
(Full disclosure: If you sign up for a free Grammarly account, I get 20¢. I use the spelling/grammar checking service all the time, but, then again, I write a lot more than most people. I recommend Grammarly because it works and it’s free.)