Created
June 21, 2012 16:31
-
-
Save rohinomiya/2966860 to your computer and use it in GitHub Desktop.
プロセス名を元に、そのアプリのウィンドウを操作する ref: http://qiita.com/items/198feae9488edc25c5d9
This file contains hidden or 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
; Sample: Send key stroke to the window from process name. | |
NotFound = 0 | |
ProgramFileName = cmd.exe | |
Process, Exist, %ProgramFileName% | |
PID = %ErrorLevel% | |
If(PID == NotFound) | |
{ | |
MsgBox, Process"%ProgramFileName%" not found. | |
ExitApp | |
} | |
; activate command prompt. | |
WinActivate, ahk_pid %PID% | |
WinWaitActive, ahk_pid %PID% | |
sleep, 500 | |
; send key stroke to command prompt | |
ControlSend, , echo message, ahk_pid %PID% |
This file contains hidden or 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
Send, {ALT DOWN}{TAB} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment