Auto import scripting allows manipulation of the file list passed to the auto import routine. Use these script methods to either sort or filter the list of files prior to import. Auto Import scripting methods are contained within one class, the AutoImportFileSetScript class.
In addition to the IsScriptMethodEnabled and EnableUnrestrictedCode methods, the AutoImportFileSetScript class contains the following:
SortFileSet returnsan array of string values representing the sorted file list. This method is called before the files are filtered and queued for import. On the Auto Import Settings screen, the setting labeled Auto Import File Sorting Method controls file sorting by creation date, modified date and file name. To sort using SortFileSort method, select the “Sort using Script” setting, check the "Filter file set by script" checkbox, and then press the Open Script Editor button:
array of string
the unsorted list of files to import
The sorted file list as an array of string values.
FilterFileSet returns either true or false. This method is called after sorting and before files are queued for import. Use FilterFileSet to remove files from the list before importing begins. Return true to signal the batch that files have been processed. Return false to reject the entire list of files.
array of string
Contains the list of fully-qualified file names detected for queuing. Alter this list to control which files will be queued for import.
True or false.
NOTE: When limiting the time window for auto import, consideration should be given to the daily file volume. The script prevents files from queueing for auto import. If file volumes are high, a large number of files can build up in the monitored locations. Once auto import is allowed to process files again, it will queue all available files which in turn can lead to a very large, unwieldy batch. When limiting the auto import time window, consider limiting the number of files that are included in each batch via the Max Imported Files Per Batch option.