Wait for Process Action

Declaration

<AMWAITFORPROCESS ACTION="options" PROCESS="text" PROCESSID="text" RESULTDATASET="text" />

See Also

Wait for Process Action-Setting Properties, Wait for Pointer, Wait for Pixel, Wait for Window, Wait for File, Close Window

Description

Causes task execution to pause at the current line until the specified process starts or ends.

Practical Usage

Commonly used to wait for an external application to start or end which could indicate that a process has completed successfully. If the process started/ended then the task could move on.

Parameters

General Tab

Action

Options, Optional, Default: start
MARKUP: ACTION="end"

Specifies whether the step should wait for the process to start or end.

The available options are:

Use Process Name

Text, Optional
MARKUP:
a) PROCESS="c:\foldername\iexplore.exe"
b) PROCESS="iexplore.exe"

Specifies the executable of the process that AutoMate should wait for. Partial matches are allowed (either the full path or the EXE name only may be specified).

(The process may be specified either by process name or by process ID—see below).

Use Process ID

Text, Optional
MARKUP: PROCESSID="3932"

Specifies the process ID for the process that AutoMate should wait for.

Create and Populate Dataset

Text, Optional
MARKUP: RESULTDATASET="DatasetName"

Specifies the name of a dataset to be created and populated with process data. In addition to the standard dataset fields, the dataset will contain the following:

Notes

Run Action Contains Same Functionality

Users should be aware that most of the functionality contained in Wait for Process <AMWAITFORPROCESS> is also contained in the Run action <AMRUN>. This action should only need to be used if AutoMate is not responsible for starting the process such as in cases where the external application or the user starts/ends the process.

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMWAITFORPROCESS PROCESS="C:\Program Files\Internet Explorer\iexplore.exe" RESULTDATASET="ProcessDataset" />

<AMWAITFORPROCESS ACTION="end" PROCESSID="3932" RESULTDATASET="ProcessDataset" />