PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.

Prev | Next | Users Guide | PhantomScript Reference | P1 Systems


Process Control

WaitForProcessReady

Syntax

WaitForProcessReady ProcessID=<pid> [Timeout=<secs>]

Description

Waits until the specified process is waiting for user input with no input pending, or until the time-out interval has elapsed.

Parameters

ProcessID=<pid>

The process ID obtained from a Command statement.

Timeout=<secs>

Optional. The number of seconds to wait for the process to exit before continuing anyway. The TimedOut intrinisic variable can be used to determine whether the wait timed out or not. The default value is zero, meaning if the process is not now ready a timeout will immediately occur.

Remarks

If the process does not exist, the wait is immediately satisfied and the TimedOut intrinsic variable is set to True.

Example

WaitForWindow Caption="*Notepad*" Result=hwnd  
WaitForProcessReady ProcessID=WindowProcess hwnd Timeout=60

The above statements start the Windows Notepad program on the specified file and then wait 60 seconds for the program to be ready to accept input.



Prev | Next | Users Guide | PhantomScript Reference | P1 Systems

PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.