action_if_process_running.htm <meta name=layout-height content=1122>
If Process Running Action
<AMIF PROCESS="text" PROCESSID="text" RESULTDATASET="text"> </AMIF>
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.
To check if a process is running and take conditional action depending on the result.
Specifies the type of check to be performed..
The available options are:
open: the IF block will be executed if the process is running.
end: the IF block will be executed if the process is not running.
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).
(The process may be specified either by process name or by process ID
Specifies the process ID for the process that AutoMate should look for.
Specifies the name of a dataset to be created and populated with process data for a running process. In addition to the standard dataset fields, the dataset will contain the following:
ProcessName: the path and file name of the process's .exe file
ProcessID: the ID of the process
WindowTitle: the title of the process's main window
WindowClass: the class of the process's main window
WindowHandlle: the handle of the process's main window
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
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
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMIF ACTION="end" PROCESS="C:\Program Files\Internet Explorer\iexplore.exe" RESULTDATASET="ProcessDataset">
<AMSPEAK ENGINE="automatic">Process is not running</AMSPEAK>
<AMSPEAK ENGINE="automatic">Process is running</AMSPEAK>