New Version of QuickLinks AutoHotkey Script

Many Changes to QuickLinks.ahk Previously Discussed, Plus a Few New Features Not Yet Covered! Now Available for Download!

I’ve finally posted the latest version of QuickLinks.ahk which includes all of the discussions from the past few weeks—plus a couple more features and fixes which I plan to talk about in the near future.

In the new version of QuickLinks.ahk, you’ll find a number of new features: multiple methods for adding icons; the Windows Tools (God Mode) option; the ability to add new items selected in Windows (File) Explorer or your Web browser address bar directly to QuickLinks with the new Add Links option.

QuickLinks with Icons

Icons are added to the menu in a few different ways.

First, you find the function AddIcon(TopMenu,SubMenu) for adding icons either to the top-level folders or the specific shortcuts on the second level.

Second, specific IfInString command lines change/insert specific types of icons.

Third, program icons are drawn directly from EXE files.

Fourth, you can manually change shortcut icon (.lnk) in Windows (File) Explorer which then automatically appear in the menu. This does not work for Web links (.url).

Caution: If you previously setup personalized icon statements in your version of QuickLinks.ahk, be sure to copy and transfer that icon setting code to this version. Otherwise, they may be overwritten. (In other words, backup your old copy of QuickLinks.ahk before overwriting it.)

Secret Windows Tool Link

QuickLinks now includes the secret Windows Tools (God Mode) link in the Tools folder for quick access to over 200 Windows settings and features cited in plain English. This feature automatically renews if deleted. If you don’t want it, then delete the code which adds Windows Tools.

Note: When editing QuickLinks/Tools shortcuts in Windows (File) Explorer, the name of the Windows Tools shortcut appears blank. Do not edit or add a different name. That process disables the shortcut.

Add Links to Menu Directly From QuickLinks Menu

You can now directly add new shortcut links to the menu by selecting a file in Windows (File) Explorer or a Web page in the address bar (URL) of a Web page, then clicking the appropriate Add Links submenu from your QuickLinks menu. You may want to later edit the shortcut in Windows (File) Explorer to change the name and possibly add a shortcut icon. Select Edit Quicklinks to open the QuickLinks folder.

It’s possible that the new version of QuickLinks may generate errors when using older links. For example, a couple of my shortcuts were looking for icons in older versions of the EXE program. I corrected the problem by deleting the old shortcut in QuickLinks and recreating the shortcut with the current version of the program.

Please let me know if you find any bugs.




4 thoughts on “New Version of QuickLinks AutoHotkey Script

  1. Very nice, Jack… it just keeps getting better. The only thing I’ve found is that sometimes just reloading the script after a change doesn’t work and generates an error. It took me a while to realize that there are times when you need to exit the script completely and run it again instead of just doing a reload from the tray menu.

    I haven’t been able to work out why shortcuts to the same type of file in the same folder can end up with different icons. A minor issue for sure, but I would love to understand what’s happening.

    Nor have I been able to change the icons of shortcuts to .PDF files to show an icon grabbed from the Foxit Reader executable. I assumed the syntax would be similar to that for shortcuts to .AHK files but the following has no effect:

    Original (line 109)

    IfInString, QL_OutTarget, `.ahk, Menu, %QL_MainMenu%, Icon, %QL_NewName%, C:\Program Files\AutoHotkey\AutoHotkeyU64.exe, 2

    changed to:

    IfInString, QL_OutTarget, `.ahk, Menu, %QL_MainMenu%, Icon, %QL_NewName%, C:\Program Files\AutoHotkey\AutoHotkeyU64.exe, 2
    IfInString, QL_OutTarget, `.pdf, Menu, %QL_MainMenu%, Icon, %QL_NewName%, C:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe, 1

    Even after an exit and running the script again, the change makes no effect.


    • I did some testing myself and seems to be associated with the PDF type shortcut. For some reason, it doesn’t allow an icon to insert into the Menu when it’s a PDF type shortcut. Go figure. It must be a Windows PDF thing. It really doesn’t seem to make any sense.

      What does work is adding an icon directly to the shortcut via “Change icon…” in the shortcut Properties window, then click Apply. The following sets the icon into the menu:

      FileGetShortcut, C:\Users\%A_UserName%\QuickLinks\%MainMenu%\%NewName%.lnk, OutTarget, OutDir, OutArgs, OutDescription, OutIcon, OutIconNum, OutRunState

      If (OutIcon != "")
      Menu, %MainMenu%, Icon, %NewName%, %OutIcon%, %OutIconNum%

      I discussed doing this in a recent blog. You must set the icon in each PDF shortcut.


      • Hi Jack,

        I amended each shortcut to the PDF files (your AHK books which I’d just purchased, as a matter of fact).

        Each amendment was carried out individually by right-clicking on each shortcut in turn, choosing ‘Properties’ then ‘Change icon’ and pointing to the same icon (‘icon 1’, not the first ‘icon 0’) in the Foxit Reader executable.

        Unfortunately, QuickLinks will no longer load fully. First I chose ‘Reload QuickLinks’ from its tray menu. This displayed a popup error window showing: “Menu does not exist. Specifically: Graphics” then, at the end, “The current thread will now exit”. The error referred to line #213:Menu,%A_LoopFileName%,Delete.

        I exited QuickLinks completely then started it afresh. The same error appeared onscreen but I noticed the QuickLinks icon in the Notification Area appeared. Using WIN+Z I found that, bizarrely, only the ‘Books’ entry appeared onscreen. Sorry but it’s hard to describe.

        (PS – You ask for feedback and to inform you of bugs but it’s actually quite difficult to do that without any means of attaching a file, whether screenshot or script, etc. It thus relies on someone’s ability to describe accurately what’s happening for them. Not a criticism, just an observation.)




  2. Part of the problem is that the error may not be in the code itself. Sometimes the folders and/or shortcuts in the folders have errors. I’ve found that sometimes shortcut paths go bad and need to be recreated.

    Based upon the error you’re getting your problem is with the Graphics folder. The error occurs when attempting to delete menus before rebuilding the menu. I would take a closer look at the Graphics folder and possibly rebuild it.

    If AutoHotkey is encountering a problem at the Graphics folder, it won’t continue with the rest of the menu.

    You might get past the termination problem with this from the Menu command options:

    UseErrorLevel [, off]: If this option is never used in the script, it defaults to OFF. The OFF setting displays a dialog and terminates the current thread whenever the Menu command generates an error. Specify Menu, Tray, UseErrorLevel to prevent the dialog and thread termination; instead, ErrorLevel will be set to 1 if there was a problem or 0 otherwise. To turn this option back off, specify OFF for the next parameter. This setting is global, meaning it affects all menus, not just MenuName.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s