Code: Select all
Drives := "CDE"
Loop Parse, Drives
if FileExist(A_LoopField ":\Dropbox"){
Drive:=A_Loopfield
break
}
OnClipboardChange("CleanLink")
SetScrollLockState, AlwaysOff
#NumPad5::
RunOrActivate2("%Drive%:\Dropbox\App Sync\Telegram\Telegram.exe", "ahk_exe Telegram.exe") ; I can't seem to put %Drive% as a parameter here.
RunOrActivate2(Target, WinTitle = "")
{
global Drive
If WinExist("%WinTitle%")
WinActivate
Else
Run, %Target%
return
}