Commands & Syntax > Commands > Macro Flow Control >

www.MacroToolworks.com

IF FOLDER - < if_dir >() ... [Pro]

 

IF FOLDER
<if_dir>("Folder path","Condition","Unused")
Available in: Professional edition

The command evaluates a folder specific condition and if it is evaluated as "true" then following macro steps (steps between "if" and "else/endif") are executed.

 

#

Parameter name

Parameter description

1

Folder path

Full path to folder to check against the condition.

2

Condition

Condition can be one from the following:
"EXIST" - the condition is true if the directory exist.
"NOTEXIST" - the condition is true if the directory does not exist.

3

Unused

Must be empty.

 

Example (Macro Steps):

 

1

<#> <#> This macro shows how to use if-dir command

2

Macro execution: ONLY COMMANDS

3

IF FOLDER "c:\windows" Exist

4

Message SHOW "" : "'c:\windows' exist." (other parameters: x = 100, y = 100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

5

ELSE activate

6

Message SHOW "" : "'c:\windows' NOT exist." (other parameters: x = 100, y = 100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

7

ENDIF

Example (Plain Text):

 

<#> This macro shows how to use if-dir command

<#>

<cmds>

<if_dir>("c:\windows","EXIST","")

   <msg>(100,100,"'c:\windows' exist.","Message",1)

<else>

   <msg>(100,100,"'c:\windows' NOT exist.","Message",1)

<endif>