Skip to content

Instantly share code, notes, and snippets.

@maestrow
Created June 6, 2018 16:38
Show Gist options
  • Save maestrow/5c0b27ed28907b2f538b9c019193a139 to your computer and use it in GitHub Desktop.
Save maestrow/5c0b27ed28907b2f538b9c019193a139 to your computer and use it in GitHub Desktop.
AutoHotKey
ShowAndPaste(pid, str)
{
;MsgBox %pid%
ClipboardCopy = %ClipboardAll%
Clipboard := str
WinShow, ahk_pid %pid%
WinActivate, ahk_pid %pid%
SendInput +{Ins}{Enter}
Clipboard = %ClipboardCopy%
}
DetectHiddenWindows, On
cmd := "d:\tools\devCli-origin.lnk"
Run, %cmd%,,Hide, PID1
Run, %cmd%,,Hide, PID2
Run, %cmd%,,Hide, PID3
WinWait, ahk_pid %PID1%
WinWait, ahk_pid %PID2%
WinWait, ahk_pid %PID3%
WinMove, ahk_pid %PID1%,, 1920,50
WinMove, ahk_pid %PID2%,, 1920,50+335
WinMove, ahk_pid %PID3%,, 1920,50+335*2
ShowAndPaste(PID1, "npm run sg")
ShowAndPaste(PID2, "npm run webpack")
ShowAndPaste(PID3, "npm run server")
Exit
DetectHiddenWindows, On
Run, %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat" && d: && cd d:\norbit\repos\CB",,Hide, PID1
Run, %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat" && d: && cd d:\norbit\repos\CB_alt",,Hide, PID2
Run, %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat" && d: && cd d:\norbit\repos\CB_alt2",,Hide, PID3
WinWait, ahk_pid %PID1%
WinWait, ahk_pid %PID2%
WinWait, ahk_pid %PID3%
WinMove, ahk_pid %PID1%,, 106,454
WinMove, ahk_pid %PID2%,, 294,527
WinMove, ahk_pid %PID3%,, 528,594
WinShow, ahk_pid %PID1%
WinShow, ahk_pid %PID2%
WinShow, ahk_pid %PID3%
Exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment