If Process Running Action Icon

If Process Running

Declaration

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

See Also

Else | End If | End Select/Case | Goto | If | If Compare Files | If File Exists | If Folder Exists | If Last Step | If Pixel Exists | If Process Running | If Text Contains | If Windows Exists | Label | Select/Case

Description

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 evaluate. Optionally, this action populates a dataset with information about the specified process.

Practical Usage

Commonly used to check if a particular process is running or is not running and performs conditional actions depending on the result.

Parameters

General Properties

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)

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

  2. PROCESS="iexplore.exe"

If enabled, specifies the executable of the process that AutoMate 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 AutoMate 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. More information on the fields that this dataset creates can be found below under Notes.

 

Description Properties

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 Properties

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

More about error causes properties

On Error Properties

The On Error tab is part of AutoMate'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

Notes

Datasets

A dataset is a multiple column, multiple row container object. 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.

 

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.

 

Description - Simple task that checks if the Inter Explorer (iexplore.exe) process is running. If so, a Speak action speaks the text "Process is running." If not, a Speak action speaks the text "Process is not running."

 

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

 

↑ [Top of Page]