Scripting Examples
The following list highlights a few of the ways you can use scripts to customize and integrate the content publication process:
- You can write scripts to get the latest version of files from your version control system or content management system. For more information, see CVS Version Control Checkout Example.
- You can use variables within scripts. For more information, see Scripting Variables and Using Scripting Variables Example.
- You can customize the log file created when ePublisher runs a job. For more information, see Show Time and Date Example and Using Scripting Variables Example.
- You can use post-processing scripts to customize the deployment process. These scripts can modify files and even rebuild the final deliverable. For example, you can use scripts to further customize the generated files and then automatically run Microsoft HTML Help Workshop to rebuild the
.chmfile.
Show Time and Date Example
This example simply displays the time and date in the log file by calling the time and date commands built into the DOS command-line interface. In this case, the script was added as a pre-build step for the job running before the first target starts generating output.

The following output shows the time and date included in the log before the first target starts the generation process. This information can automatically timestamp a job log file. You can also use these values in your script to log elapsed time and make decisions.
WebWorks Automap
09:57 AM
Mon 6/23/2008
Scanning 1 document(s)...
Building target: WebWorks Help 5.0
Generation started at 9:57:15 AM
Initializing file information
Updating documents.
Applying settings to WebWorks.doc, 1 of 1.Using Scripting Variables Example
This example creates a simple mini-report inside the log file for each target in the job. This simple example demonstrates the use of the scripting variables. In this case, the values of the variables are displayed as part of the report using the echo command built into the DOS command-line interface.
The following figure shows some of the variable names surrounded by single quotes. You do not need to enclose variable names in quotes. These quotes are there only to show emphasis on the variable values in the mini-report example.

The following output shows the mini-report displayed immediately after the target starts to be built. You could add this same script as a post-build step for the target and a similar mini-report would be created when the target is done being generated.
Building target: WebWorks Help 5.0
--- Target Mini-Report for WebWorks Help 5.0 ---
'WebWorks Help 5.0' is running from the 'Scripting Demo' job located at `C:\Users\<UserName>\Documents\WebWorks AutoMap\Jobs\Demo`.
Currently running the **PreBuild** script for the *WebWorks Help 5.0* target. *WebWorks Help 5.0* will deploy to *Online Help* located in the `C:\Users\<UserName>\AutoMapOutput\Help Systems\Online Help` folder.
So far, 0 errors have occurred.
--- End of WebWorks Help 5.0 mini-report ---
Generation started at 9:57:15 AM
Initializing file information
Updating documents.
Applying settings to WebWorks.doc, 1 of 1.CVS Version Control Checkout Example
The previous example scripts demonstrate some simple capabilities of using scripts in ePublisher AutoMap. This example shows how to check out source files from a version control system at the start of a job.
Version control systems let you store files and retain information concerning different versions of those files. You can store multiple versions of files, revert to previous versions of files, and share files among large groups of people. The advantage of using a version control script to retrieve source files rather than adding them directly to a project ensures that your job is always working with the latest checked in version of each source file.
Each version control system works in a slightly different way. ePublisher AutoMap is not tied to a specific version control solution. ePublisher AutoMap provides an abstract way of retrieving a list of source files to transform. There are a few rules about how this list is named and formatted, but the actual creation of the list is left to the script and scriptwriter.
The scripting capabilities in the Documents panel are not limited to checking files out of a version control system. The only requirement is that the
FileList.txt file includes a list of files and paths to be transformed. You can access the FileList.txt file and the path to it using the ePublisher AutoMap ${FileListName} and ${FileListPath} scripting variables. For more information, see Scripting Variables.The following script example calls
getfilesaction_cvs.vbs, which is installed with ePublisher AutoMap. By default, this script is located in the following location:\Program Files\WebWorks\ePublisher AutoMap\Scripts\getfilesaction_cvs.vbsThe
getfilesaction_cvs.vbs script is written using the Visual Basic Scripting (VBS) capabilities built into Microsoft Windows to check out files from a CVS (Concurrent Version System) server and create a file list to be processed by ePublisher AutoMap. This script is not meant to be used in its current form. This script provides a starting point that includes everything you need to set up a working script for your particular environment.The
getfilesaction_cvs.vbs script includes comments to help someone with scripting experience understand the actions it performs. Since this script provides only a starting point, you need to modify this script for your environment. For example, you need to set the CVS attributes for your user name, server name, and type of authentication. You also need to adjust for how CVS is installed and called in your environment. These areas of the script are highlighted in the following figure:The following figure shows an example of how to call the
getfilesaction_cvs.vbs script. The parameters passed indicate the module to checkout and to filter on the .doc extension. When this script runs, it checks out the indicated module from CVS, filters those files based on the .doc extension, and adds those .doc files to the FileList.txt file. That file list is then used by the job as the list of files to process and transform.
This example is only one possible way of creating a list of files to transform. Once you understand the mechanism that ePublisher AutoMap uses to retrieve its list of source documents to transform, you can create that list using the process you prefer. Whether you want to use a script or an application, ePublisher AutoMap can run it from the script editor as long as it is available to ePublisher AutoMap.
Last modified date: 01/28/2026