Commands & Syntax > Commands > Macro Flow Control >

If PROCESS - < if_process >() ... [Pro]

www.perfectkeyboard.com

 

If PROCESS
<if_process>(File,Condition)
Available in: Professional edition

This command checks whether specified process is running or not. If the condition is evaluated as "true" then macro steps between "if" and "else/endif" are executed.

 

#

Parameter name

Parameter description

1

File

Name of the executable file (example: notepad.exe) or process identification number (example: 101876).

2

Condition

Must be one of these values:
EXIST
NOT_EXIST

 

Example (Macro Steps):

 

1

<#> <#> This example checks whether Notepad is running

2

<#> <#>

3

Macro execution: ONLY COMMANDS

4

If PROCESS "notepad.exe" Exist

5

Message SHOW "" : "Notepad is running." (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

6

ELSE activate

7

Message SHOW "" : "Notepad is NOT running." (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

8

ENDIF

Example (Plain Text):

 

<#> This example checks whether Notepad is running

<#>

<cmds>

<if_process>(notepad.exe,EXIST)

   <msg>(-100,-100,"Notepad is running.","Message",1)

<else>

   <msg>(-100,-100,"Notepad is NOT running.","Message",1)

<endif>