Launching an application

Hi,

I was looking through the forum and noticed some people use macros to launch applications.

The way I’m currently doing it is by having a macro clicking the win button, then typing the name of the program and then clicking enter.
It usually works fine but sometimes the delay between pressing the win key until it opens the text box is too high so I’m fine tuning the delay command each time.

However, I wondered if someone has a better way to launch applications.
I know I can use Win Key + R as well but I guess it will have almost the same issue as my current configuration.

Under Windows I would use an extra application to launch programs. If you do not mind writing a tiny simple script I suggest Autohotkey, which allows very easily to assign a hotkey to launch a specific application. The excellent included documentation shows in an example how to launch Notepad. Then in UHK you can assign that key combo to whatever key you like.

I use this script for example to have a nice display of volume control when changing volume with Win-ArrowDown/Up or Mute with Pause:

; Joe Winograd 27-Aug-2018
; for Autohotkey V1.1 (not tested with V2)
; Developed for Windows 10, but tested successfully on W7, W8.1, and W10 (all 64-bit)
; Updated with Toggle Mute feature 10-Mar-2021
; Updated with Red and Green sliders for Muted and Unmuted states 10-Mar-2021
; 2021-03-14: changed default hotkey to Win-Up and Win-Down and Pause
; 				 added decrease parameter step to allow faster turning down of the volume


#Warn,UseUnsetLocal
#NoEnv
#SingleInstance force
SetBatchLines,-1

; begin values to change
BarWidth:="w800"
BarHeight:="h20"
BarXlocation:="x500"
BarYlocation:="y100"
BarColorMuted:="Red"
BarColorUnmuted:="Green"
BarMillisecondsToStayOnScreen:=1000 ; 1 second
HotkeyVolumeDown:="#Down"
HotkeyVolumeUp:="#Up"
HotkeyToggleMute:="Pause"
;HotkeyVolumeDown:="NumpadSub"
;HotkeyVolumeUp:="NumpadAdd"
;HotkeyToggleMute:="NumpadMult"
VolumeIncrement:=1
VolumeDecrement:=2
; end values to change

SplitPath,A_ScriptName,,,,ProgramName
Hotkey,%HotkeyVolumeDown%,VolumeDown
Hotkey,%HotkeyVolumeUp%,VolumeUp
Hotkey,%HotkeyToggleMute%,ToggleMute
SoundGet,Volume
Volume:=Round(Volume)
TrayTip:=HotkeyVolumeDown . " or " . HotkeyVolumeUp . " to adjust volume" . "`n" . HotkeyToggleMute . " to toggle mute" . "`nCurrent Volume=" . Volume
TrayIconFile:=A_WinDir . "\System32\shell32.dll" ; get tray icon from shell32.dll
TrayIconNum:="-225" ; use music note as tray icon (icon 225 in shell32)
Menu,Tray,Tip,%TrayTip%
Menu,Tray,Icon,%TrayIconFile%,%TrayIconNum%
Gui,+ToolWindow -SysMenu
Gui,Add,Progress,%BarWidth% %BarHeight% c%BarColor% vBarVal
Gui,Hide
Return ; end auto-execute

VolumeDown:
SetTimer,SliderOff,%BarMillisecondsToStayOnScreen%
SoundSet,-%VolumeDecrement%
Gosub,DisplaySlider
Return

VolumeUp:
SetTimer,SliderOff,%BarMillisecondsToStayOnScreen%
SoundSet,+%VolumeIncrement%
Gosub,DisplaySlider
Return

ToggleMute:
SoundSet,+1,,Mute ; toggle the mute setting
Return

SliderOff:
Gui,Hide
Return

DisplaySlider:
SoundGet,MuteState,,Mute
If (MuteState="Off")
  BarColor:=BarColorUnmuted
Else
  BarColor:=BarColorMuted
SoundGet,Volume
Volume:=Round(Volume)
Title:=ProgramName . "     Current Volume=" . Volume
Gui,Show,%BarXlocation% %BarYlocation%,%Title%
GuiControl,,BarVal,%Volume%
GuiControl,+c%BarColor%,BarVal
TrayTip:=HotkeyVolumeDown . " or " . HotkeyVolumeUp . " to adjust volume" . "`n" . HotkeyToggleMute . " to toggle mute" . "`nCurrent Volume=" . Volume
Menu,Tray,Tip,%TrayTip%
Return

EDIT: another launcher in included in MS Powertoys

1 Like

I wasn’t familiar with Autohotkey.
That is a nice solution if you don’t mind relying on a software and I will definitely try it.
Thank you

And if you are on Linux I would recommend keyd (GitHub - rvaiya/keyd: A key remapping daemon for linux.), it allows you all kinds of input mapping for your keyboard including launching programs.

1 Like

I use a launcher (in my case ulauncher) and map it to Mod+Space

1 Like

I’m in need of a new launcher. Still trying to use synapse, but the project seems dead. When synapse is working it does a good job especially with regards to picking popular applications rather than just matching the letters.

Why don’t you use windows embedded shortcut keys?
It’s the easiest way to accomplish what you want without installing anything else.

I’m using ulauncher too. Works like a charm.
It required an extra plugin in order to open project in intellij though.

Windows shortcuts do not exist for many applications.