If Folder Exists Action Icon

If Folder Exists

Declaration

<AMIF FOLDER="text" ISNEWERTHAN="date" ATTRFILTER="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

Causes the steps following this action to execute if the specified folder is in the specified state. If not, execution follows the next Else or End If action, whichever comes first. This action accepts wildcard masks (i.e. * or ?).

Practical Usage

Generally used to check if a folder exists (or does not exist) and execute conditional actions depending on the result.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

If

Text (Options)

Yes

Folder exists

ACTION="not_exist"

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

  • Folder exists: the IF block will be executed if the specified folder exists.

  • Folder does not exist: the IF block will be executed if the specified folder does not exist.

Folder

Text

Yes

(Empty)

FOLDER="c:\foldername"

Specifies the folder to check. This action accepts wildcard masks (i.e. * or ?).

 

Advanced Properties

Property
Type
Required
Default
Markup
Description

Exclude Mask

Text

No

(Empty)

EXCLUDE="folder1*"

Causes this action to omit folders matching the masks specified. File names or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|). Example: folder1*|folder2*

Only if Newer Than

Date

No

(Empty)

ISNEWERTHAN=

"%DateSerial(2007,02,01) + TimeSerial(00,00,00)%"

Causes this action to evaluate only folders newer than the date/time specified. If this parameter is left blank or not included, the folder date will be ignored.

Only if Older Than

Date

No

(Empty)

ISOLDERTHAN=

"%DateSerial(2007,02,01) + TimeSerial(00,00,00)%"

Causes this action to evaluate only folders older than the date/time specified. If this parameter is left blank or not included, the folder date will be ignored.

 

Attributes Properties

Property

Type

Required

Default

Markup

Description

Attributes

Text Options

No

(Empty)

ATTRFILTER="+R+A-H" (compress read-only & archive files but not hidden files)

This group of settings causes the action to filter which files to look for based on the attribute settings of the source files. In visual mode, a group of controls are provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you wish to look for.

Available Options:

  • R—Read-only: Specifying "+R" causes files with this attribute turned on to be included, "-R" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • A—Archive: Specifying "+A" causes files with this attribute turned on to be included, "-A" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • S—System: Specifying "+S" causes files with this attribute turned on to be included, "-S" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • H—Hidden: Specifying "+R" causes files with this attribute turned on to be included, "-H" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • C—Compression: Specifying "+C" causes files with this attribute turned on to be included, "-C" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
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:

 

<AMIF FOLDER="C:\Temp">

     <AMMESSAGEBOX>Folder exists.</AMMESSAGEBOX>

<AMELSE />

     <AMMESSAGEBOX>Folder does not exist.</AMMESSAGEBOX>

</AMIF>

 

↑ [Top of Page]