I'm planning to provide this launcher script in the scripts forum, but here it is for you. It is very simple to use. Copy any LNK shortcut files of interest into a single folder. In the script, just change LNKdirectories so that it names that folder. You can have more than one such folder in that array. Run the script. That's it. It will build a GUI from those files.
WIN / launches the GUI; you can change the shortcut. Select a file to run from the GUI. You can type the first few letters to jump to it. I tried lots of launchers-- Launchy, Keypirinha, and a few others-- all quite good-- but this one is as good as any of them for those who don't need the other features that some of them have. You can rename your shortcut files to anything you want, to make it easier for you to find and run them from this GUI. If you make a change to the shortcut files, update the GUI simply by reloading the script. I keep this running at all times and use it at least a few times every hour.
Code: Select all
/* mwLaunch --------------------------------------------
By Michael Weiner, Indianapolis, Indiana, U.S.A. on 13 October 2020
This AutoHotkey script displays a ListView that enables launching of programs using their LNK shortcut files.
This script may be run alone, or included in another script if "GoSub, LaunchStart" is issued at the start.
Modify LNKdirectories to refer to directories that contain LNK shortcut files to be listed in the GUI.
If needed, modify the hotkey to launch the GUI. The current hotkey is WIN-/ (WIN key combined with "/").
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=81937
--------------------------------------------------------
*/
LaunchStart:
; --- Directories with LNK files to be listed in GUI -------------
LNKdirectories := ["E:\data\quicklaunch"
, "E:\data\utils\lnk"]
; ----------------------------------------------------------------
Global LaunchList
getLaunches(LNKdirectories)
Return
; --- Hotkey to launch the GUI -----------------------------------
#/::Gui, Launch:Show
; --- No need to change anything below this line -----------------
LaunchButtonOK:
GuiControlGet, fcontrol, FocusV
If (fcontrol != "LaunchList")
Return
LV_GetText(app, LV_GetNext("F"), 2) ; Get the path from the focused line in the ListView
Gosub, LaunchGuiEscape ; Hide the GUI
Run, %app%
Return
LaunchGuiEscape:
Gui, Launch:Hide
Return
getLaunches(launchDirs) {
For index, launchDir in launchDirs { ; Loop through the launch directories
Loop, Files, % launchDir "\*.*", R ; Find each file in the directory; include subdirectories
{
SplitPath, A_LoopFileName,,,, fnBare ; Find the file name without extension
If A_LoopFileExt not in ini ; Skip INI files
list .= "`n" (A_LoopFileExt = "lnk" ? fnBare : A_LoopFileName) "`t" A_LoopFileFullPath ; Build the list
}
}
list2 := SubStr(list, 2), list := "" ; Delete the first line feed
Sort, list2
Loop, parse, list2, `n, `r ; Eliminate duplicates
{
fn := RegExReplace(A_LoopField, "^(.+)\t.+$", "$1")
If (fn != oldFN) ; This item is not a duplicate
list .= "`n" A_LoopField, oldFN := fn
}
list := SubStr(list, 2), part := {}
Gui, Launch:New,, Launch list ; Build the GUI
Gui, Launch:Font, s10
Gui, Launch:Add, ListView, BackgroundF9DDC7 r22 w700 vLaunchList Count1200 Grid -Multi, Name|Path
GuiControl, -Redraw, LaunchList
Loop, parse, list, `n, `r
{
Loop, parse, A_LoopField, `t
part[A_Index] := A_LoopField
LV_Add("", part.1, part.2) ; Add each item to the listview: file name and full path
}
GuiControl, +Redraw, LaunchList
LV_ModifyCol() ; Auto-size each column to fit its contents.
Gui, Launch:Add, Button, w0 h0 hidden Default, OK ; User can select an entry and then press ENTER to execute
}