一个非常棒的AutoHotKey脚本

2010 - 10 - 22

http://macrochen.javaeye.com/blog/791788

文章分类:综合技术
引用
; Function to run a program or activate an already running instance 
RunOrActivateProgram(Program, WorkingDir="", WindowSize=""){ 
    SplitPath Program, ExeFile 
    Process, Exist, %ExeFile% 
    PID = %ErrorLevel% 
    if (PID = 0) { 
    Run, %Program%, %WorkingDir%, %WindowSize% 
    }else{ 
    WinActivate, ahk_pid %PID% 
    } 

^!w::RunOrActivateProgram("D:/Program Files/EditPlus/editplus.exe") 
^!f::RunOrActivateProgram("C:/Program Files/mozilla firefox/firefox.exe") 
^!o::RunOrActivateProgram("C:/Program Files/Microsoft Office/Office12/OUTLOOK.EXE") 
^!c::RunOrActivateProgram("D:/Program Files/SecureCRT+FX/SecureCRT.exe") 
^!d::RunOrActivateProgram("D:/Program Files/Q-Dir/Q-Dir.exe") 
^!e::RunOrActivateProgram("D:/eclipse/eclipse-java-helios-win32/eclipse.exe")

你可能感兴趣的:(AutoHotkey)