Wait for Process Action Icon

Wait for Process

Declaration

<AMWAITFORPROCESS ACTION="text (options)" PROCESS="text (process name)" RESULTDATASET="text (dataset name)" />

See Also

Pause Task | Wait for File | Wait for Pixel | Wait for Pointer | Wait for Process | Wait for Window | Stop Timer | Read Timer  | Start Timer

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 Properties

Property

Type

Req'd

Default

Markup

Description

Action

Text (options)

Yes

Match

ACTION="start"

Specifies whether the step should wait for the process to start or end. The available options are:

  • Wait for process to start: The action will wait for the specified process to start.

  • Wait for process to end: The action will wait for the specified process to end.

Use Process Name

Text

No

(Empty)

  1. PROCESS="c:\folder\iexplore.exe"

  2. PROCESS="iexplore.exe"

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).

NOTE: The process may be specified either by process name or by process ID—see below.

Use Process ID

Number

No

(Empty)

PROCESSID="3932"

The process ID of the process that AutoMate should wait for.

NOTE: The process may be specified either by process name or by process ID.

Create and populate dataset

Text

No

(Empty)

RESULTDATASET="DatasetName"

The name of a dataset to be created and populated with process data. More on the fields that this dataset creates can be found under Notes below.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes properties

On Error Properties

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

Notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the dataset name assigned was theDataset).

Name

Type

Return Value

theDataset.ProcessName

Text

Returns the path and file name of the process's .exe file.

theDataset.ProcessID

Number

Returns the ID of the process.

theDataset.WindowTitle

Text

Returns the title of the process's main window.

theDataset.WindowClass

Text

Returns the class of the process's main window.

theDataset.WindowHandle

Number

Returns the handle of the process's main window.

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.

 

Sample Task 1 - Wait for Internet Explorer process to start.

 

<AMWAITFORPROCESS PROCESS="C:\Program Files (x86)\Internet Explorer\iexplore.exe" RESULTDATASET="theDataset" />

 

 

Sample Task 2 - Wait for Internet Explorer process to end.

 

<AMWAITFORPROCESS ACTION="end" PROCESS="C:\Program Files (x86)\Internet Explorer\iexplore.exe" RESULTDATASET="theDataset" />

 

↑ Top of Page