Script to load AutoMap with documents from specified directory location

Specify the folder to retrieve documents from with <DOCUMENTS_PATH>.

dir "<DOCUMENTS_PATH>\*.docx" /B /S > "${FileListPath}"

How this works.

The files located in the <DOCUMENTS_PATH> folder that have the extension "*.docx" will be added to the file name provided by AutoMap in the variable: ${FileListPath}.

The file names will include the full path of the file, which will allow AutoMap to find them easily, regardless of where the job file is located. The "/B /S" options for the dir are key to getting the file names written properly into the file provided by AutoMap.

Alternative script

This script copies the original source documents to a new folder within the job folder, next to the AutoMap job file. This script is likely not as ideal, but its included here as a reference for how other scripts can be created to do more operations.

rmdir /S /Q docs
mkdir docs
xcopy /E "<DOCUMENTS_PATH>" docs
dir docs\*.fm /B /S > "${FileListPath}"

How it Works

A subdirectory called "docs" will be created that contains all the files (including subdirectories) located in <DOCUMENTS_PATH>. All documents with the specified file extension will be included in the AutoMap publication. In this case filenames with a ".fm" extension are published.

Script steps explained:

  1. The above script removes any previously existing "docs" subdirectory inside the directory that contains the AutoMap job file and then creates a new "docs" directory that is empty.

  2. All files located in the directory <DOCUMENTS_PATH> are copied to the "docs" subdirectory, with recursion to retrieve any subdirectories.

  3. Finally the "dir" command is used to create a list of all the files located in the "docs" subdirectory that have the ".fm" extension.

HelpCenter/Tips/VersionControl/AutoMapDocumentCheckoutScripts/FileSystem (last edited 2024-01-09 04:41:28 by TonyMcDow)