File System Trigger

See Also

Introduction to Triggers, Available Triggers, Using AMTrigger, File Watcher Trigger, Setting a File Watcher Trigger

Description

Triggers the task when one or more files are added, modified or deleted in the folder(s) specified.

NOTE TO NETWORK USERS:
File Watcher triggers will work on network drives and shares only if the machine is part of a domain and if the machine AutoMate is running on has at least read access to the folder being watched. In addition, network folders need to be specified via UNC (Universal Naming Convention) path instead of a mapped drive. For example:

Z:\Pathname\Foldername should be \\Servername\Pathname\Foldername.

This is because mapped drives can be created and used only when a user is logged on and are unavailable when the user is logged off.

Practical Usage

Most frequently used to monitor folders for incoming files. When these files arrive, they can be automatically copied, read, uploaded, moved, renamed or a number of other AutoMate actions can be used to complete the process.

Parameters

General Tab

Folder to watch

Specifies the folder that this trigger will monitor. Click the Folder icon to navigate to a specific folder or manually enter the path the folder in the provided text-box.

 

Watch Sub-folders

If enabled, specifies that sub-folders that reside in the parent folder specified in the Folder to watch parameter will be monitored as well.

 

Wait for file to be accessible before triggering

If enabled, specifies that the file must be accessible and not in a "locked" state. Non-accessible files are usually currently being used by a user or application. As soon as the file is no longer being used, the trigger will become active.

 

Use custom polling interval for network shares

If enabled, specifies the time frame in which AutoMate polls or "checks" for the specified condition.

 

File Actions Tab

 

File Added

If enabled, specifies that the trigger will monitor for file(s) to be added to the monitored folder (enabled by default).

 

File Removed

If enabled, specifies that the trigger will monitor for file(s) to be removed from the monitored folder.

 

File Modified

If enabled, specifies that the trigger will monitor for file(s) from the monitored folder to be modified. Modifications include file renaming, alteration of contents or modification of attributes.

 

Number of files exceeds

The trigger will activate if the number of files in the monitored folder exceeds the amount entered.

 

One file size exceeds

The trigger will activate if a file in the monitored folder exceeds the amount entered in kilobytes.

 

Folder size exceeds

The trigger will activate if the total size of the folder being monitored exceeds the amount of kilobytes entered.

 

Filters Tab

 
Include Mask

Specifies the filter(s) to be included in the search.

 

Exclude Mask

Specifies the filter(s) to be omitted from the search.

 

NOTE: The Include Mask and Exclude Mask parameters can be filtered using a full path and filename or filename only. (i.e. C:\Temp\filename.txt or C:\Temp\*.txt or *.txt). Additionally, multiple filters can be specified by using a vertical bar or pipe ("|") (i.e. C:\Temp\*.txt|*.jpg).

 

Behavior Tab

Trigger on startup if condition is true

If enabled, the system will act upon conditions that already exist upon startup of the current trigger. For example, if the Notepad window is already open on the desktop, a newly created Window trigger set to monitor for the existence of a Notepad window will trigger the task as a result. If disabled, the trigger will ignore the open Notepad window upon startup.

Trigger after the condition has been met 'X' times.

If enabled, specifies how many times the trigger condition must be met before the task is started (disabled by default). This parameter is available in all triggers except the Schedule Trigger.

 

AMTrigger Parameters

 

When this trigger is activated, it automatically passes the "AMTrigger" object to the task. AMTrigger can be used within a task to determine whether or not the task was started by a trigger, which trigger started the task, when the trigger was activated and other trigger related properties. For more details, see Using AMTrigger.

 

Common AMTrigger Fields

 

Every instance of AMTrigger populates a list of common fields which are described in the table below.

 

Name

Data Type

Return Value

AMTrigger.Trigger

String

Returns the name of the event or condition that triggered the task. Each event or condition contains a unique name. For this trigger, the value is always AMFILETRIGGER..

AMTrigger.TaskName

String

Returns the name of the managed task that the trigger was attached to. Useful to determine the responsible task when two managed tasks point to the same AML file.

AMTrigger.TriggerredDateTime

String

Returns the date and time when the trigger occurred.

AMTrigger.TriggeredOn

String

Returns the machine name where the trigger occurred.

AMTrigger.WasLocked

Boolean

If the workstation was locked when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger.WasLoggedOff

Boolean

If the workstation was logged off when the trigger occurred, the value returned is 1. Otherwise, it will be 0.

AMTrigger.AML

String

Returns a verbose set of information about the triggered event or condition in AML (AutoMate Markup Language) format.

 

Specific AMTrigger Fields

 

The AMTrigger fields described in the table below are specific only to File System triggers.

 

Name

Data Type

Return Value

AMTrigger.Filename

 

Text

Specifies the path and filename of the file that was added, modified or deleted (depending on the trigger settings) .

AMTrigger.Action

Text

Specifies the action that took place to cause the task to trigger. The value can be one of the following:

  • FILE ADDED

  • FILE DELETED

  • FILE MODIFIED

  • TOO MANY FILES

  • ONE FILE TOO BIG

AMTrigger.Size

 

Number

If the AMTrigger.Action field returns "ONE FILE TOO BIG", this value is the size (in KB) of the file or folder that activated the trigger.

AMTrigger.NBFiles

Number

If the AMTrigger.Action field returns "TOO MANY FILES", this value is the total number of files in the directory being monitored.

 

NOTE: A full list of AMTrigger objects exclusive to each trigger can be viewed from the Expression Builder by expanding Objects -> Triggers and selecting the desired trigger.

See Also

About Triggers

All Available Triggers

Using AMTrigger