Skip to content

Instantly share code, notes, and snippets.

@andrewvmail
Last active August 28, 2023 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewvmail/47c7c763ceb37ddfc3354e2a05d6663d to your computer and use it in GitHub Desktop.
Save andrewvmail/47c7c763ceb37ddfc3354e2a05d6663d to your computer and use it in GitHub Desktop.
open program shortcut in bin
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