Jump to content

Send Keys To Window if Window is Unresponsive


 Share

Recommended Posts

Was wondering how you would go about writing something that if a window isn't displaying text at least 30 second intervals to send the keys CTRL, C, N to that specific window? Because I am running a batch script with a third party command prompt text usually gets displayed in thirty second intervals in the window if everything is going right. And sending CTRL, C, N, scripts the current command and goes to the next one which I want to do.

I can understand the finding the windows and probably sending keys but don't know what I would use for making sure the window is constantly displaying text at least 15, 30 seconds. Any help is appreciated.

Link to comment
Share on other sites

This might be a nicer solution? Have a play with it :)

; Demonstrates StdoutRead()
#include <Constants.au3>

Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
Wend

While 1
    $line = StderrRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

MsgBox(0, "Debug", "Exiting...")

Cheers,

Brett

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...