File System Trigger

Description

Triggers task execution when one or more files are added, modified or deleted in the folder specified. Can also trigger execution when a number of files exceed the amount specified, when one file size exceeds the amount specified or when the total size of the monitored folder exceeds the amount specified.

NOTE:  File triggers will work on network drives and shares only if the target machine is part of a domain and the machine where AutoMate resides has at least read access to the remote 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, uploaded, renamed, encrypted, compressed or a number of other AutoMate actions can be used to complete the process.

Parameters

General properties

Property

Description

Folder to watch

The folder that this trigger will monitor. Click the Folder icon to navigate to the folder you wish to monitor or manually enter the full path and folder name in the provided text-box.

Watch sub-folders

If enabled, specifies that sub-folders that reside in the target folder (specified in the Folder to watch parameter) will be monitored as well. This parameter is disabled by default.

Wait for file to be accessible before triggering

If enabled, specifies that the trigger will delay task execution until the target file(s) are accessible and no longer in a "locked" state. Non-accessible or locked files are usually being used by a user, application or other system resource. As soon as the file is no longer being used, the trigger will become active.

Use custom polling intervals for network shares.

If enabled, indicates the time frame (measured in seconds) that AutoMate should poll or "check" for the occurrence of the specified condition. This feature may reduce bandwidth in high traffic networks.

File Actions Properties

Property

Description

File added

If enabled, this trigger will monitor for the specified file(s) to be added to the target folder and start the task as a result (enabled by default).

File removed

If enabled, this trigger will watch for the specified file(s) to be removed from the monitored folder and start the task as a result (disabled by default).  

File modified

If enabled, the trigger will start the task as a result of any modifications made to the specified file(s). File changes include renaming, alteration of contents or modification of attributes.

Number of files exceed

Task execution starts when the total number of files in the monitored folder surpasses the value entered. If no value is entered, this parameter is ignored.

One file size exceeds

Task execution starts when the size of a single file residing in the monitored folder surpasses the amount entered (in kilobytes).  If no value is entered, this parameter is ignored.

Folder size exceeds

The trigger will execute the task if/when the total size of the folder being monitored exceeds the amount of kilobytes entered.  If no value is entered, this parameter is ignored.

 

NOTE: Selecting two or more of the above options will make the trigger behave as an OR statement as opposed to an AND statement. For example, enabling the parameter File Added and entering 1 under the parameter Number of files exceeds will activate the trigger when a file is added to the specified folder OR when the number of files in the specified folder exceeds the selected amount.   

Filters Properties

Property

Description

Include Mask

Specifies the filter(s) that should be included in the search. This parameter supports full path and file name entry or file name only. It also supports wildcards. For example:

  • C:\Temp\filename.txt

  • C:\Temp\*.txt

  • *.txt.

Additionally, multiple filters can be specified by using a vertical bar or pipe. Example: C:\Temp\*.txt|C:\Temp\*.jpg|C:\myFolder\*.xls.

Exclude Mask

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

  • C:\Temp\filename.txt

  • C:\Temp\*.txt

  • *.txt.

Additionally, multiple filters can be specified by using a vertical bar or pipe. Example: C:\Temp\*.txt|C:\Temp\*.jpg|C:\myFolder\*.xls.

Users Properties

If this trigger is set to monitor a folder or file location on a network share or drive, or a location with limited or restricted access, a user with proper permissions to that drive or share is required.

NOTE: These options are only supported on Windows NT/2000/2003/XP operating systems. They are not supported on Windows Vista or Windows 7 operating systems.

 

Property

Description

No user account

If enabled, no user account is required to access the specified drive or share (enabled by default).

Use default user account (specified in System Options)

If enabled, the user entered in System -> Options -> Default User tab will be used (disabled by default).

Use specified user account

If enabled, the user account entered below will be used (disabled by default). This account will always override the Default User option.

Username

The username that this trigger should use to access the folder or file location on a network share or drive, or location with limited or restricted access.

Password

The password that this trigger should use to access the folder or file location on a network share or drive, or location with limited or restricted access.

Domain or Machine Name

The domain or machine name of the location being monitored.

Behavior Properties

Property

Description

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 immediately launch the task as a result. If disabled, the trigger will ignore the open Notepad window upon startup. This parameter is disabled by default.

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. For example, if a Window trigger is set to monitor for the appearance of a Notepad window and this parameter is set to 3, the task will not launch until the third instance of Notepad appears on the desktop. This parameter is disabled by default.

 

 

AMTrigger

 

When this trigger is activated, it automatically passes the "AMTrigger" object to the subsequent 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 properties related to the triggered event.

Exclusive AMTrigger Parameters

A unique set of AMTrigger values exclusive to each trigger object are created and populated along with the collection of common values created by every instance of AMTrigger. The AMTrigger values described in the table below are exclusive only to File System triggers.

 

Name

Data Type

Return Value

AMTrigger.Filename

Text

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

AMTrigger.Action

Text

Returns 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

↑ Top of Page