If Process Running

Executes the steps immediately following this step if the specified process is in the specified state. Otherwise, step execution follows the next Else step, or End If step. Wildcards can be used to specify the process to look for. Optionally populates a dataset with the process and window data for a running process. Commonly used to check if a particular process is running or is not running and performs conditional actions depending on the result. This action creates and populates a dataset with the following fields (rows):

Name

Type

Return Value

theDataset.ProcessName

Text

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

theDataset.ProcessID

Text

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.

Declaration

<AMIF PROCESS="text" PROCESSID="text" RESULTDATASET="text"> </AMIF>

Example

<AMIF ACTION="end" PROCESS="C:\Program Files\Internet Explorer\iexplore.exe" RESULTDATASET="ProcessDataset">

<AMSPEAK ENGINE="automatic">Process is not running</AMSPEAK>

<AMELSE />

<AMSPEAK ENGINE="automatic">Process is running</AMSPEAK>

</AMIF>

See Also: If, If Compare Files, If Folder Exists, If Last Step, If Pixel Exists, If Text Contains, If Windows Exists, End If, End Select/Case, Goto, Label, Select/Case, Else

General Tab

Property

Type

Required

Default

Markup

Description

If

Text (Options)

Yes

Process is running

ACTION="end"

Specifies the type of check to be performed. The available options are:

  • Process is running: the IF block will be executed if the process is running.

  • Process is not running: the IF block will be executed if the process is not running.

Use Process Name

Text

No

(Empty)

a)PROCESS="c:\folder\iexplore.exe"

b)PROCESS="iexplore.exe"

If enabled, specifies the executable of the process that AWE should look for. Partial matches are allowed (either the full path or the EXE name only may be specified). If this parameter is enabled, the Use Process ID parameter is ignored.

Use Process ID

Text

No

(Empty)

PROCESSID="3648"

If enabled, specifies the process ID matching the process that AWE should look for. If this parameter is enabled, the Use Process Name parameter is ignored.

Create and Populate Dataset

Text

No

(Empty)

RESULTDATASET="DatasetName"

The name of a dataset to be created and populated with process data for a running process.

Description Tab

The Description tab allows you to customize the text description of any step when it appears in the Steps Pane.

More on setting custom step description

Error Causes Tab

The Error Causes tab is part of AWE's Error Handling functionality which allows you to select / omit specific errors that will cause a particular step to fail.

More about error causes

On Error Tab

The On Error tab is part of AWE's Error Handling functionality which allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

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