Last active
August 26, 2024 02:44
-
-
Save andrewvmail/47c7c763ceb37ddfc3354e2a05d6663d to your computer and use it in GitHub Desktop.
open program shortcut in bin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process := A_Args[1] | |
if WinExist("ahk_exe " process) | |
{ | |
;MsgBox, Process %process% exist. just focus in | |
WinActivate, ahk_exe %process% | |
WinGet, ActiveProcessName, ProcessName, A | |
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName% | |
IF WinClassCount = 1 | |
Return | |
Else | |
WinSet, Bottom,, A | |
WinActivate, ahk_exe %ActiveProcessName% | |
} | |
else | |
{ | |
;MsgBox, Process %process% does not exists. start shortcut | |
Run, C:\bin\%process%.lnk | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment