|
|
|
|
|
|
Scripts can be specified to run before and after a job generates, before and after each target generates, and used to retrieve source documents on a per group basis. For more information on setting up jobs, please see Creating and working with project-based jobs and Creating and working with stationery-based jobs respectively.
|
2. |
Click the appropriate Edit Script button to open the script editor window. |
|
2. |
Type your script or paste (CTRL+V) from the clipboard. |
|
2. |
Double click the variable name in the Script Variables pane to insert it |
|
3. |
Alternatively, you may type the variables name surrounded with ${ }. For example, to include the project directory variable in your script type ${ProjectDir}. |
Some variables only have meaning for certain types of scripts. For example, the DeployFolder variable is specific to a target and will not having meaning in a pre-build or post-build job script.
|
|
Please see Using scripting variablesfor more details on using ePublisher AutoMap scripting variables. |
Batch files on Windows are associated with a working folder. A working folder is the current working directory used by an application (or batch file) for processing. For example, if a batch file creates a new file without specifying a path, it will be created in the working folder. Similarly, if it attempts to read a file without a specifying a path, it is assumed to be in the working folder.
The working folder for a ePublisher AutoMap batch file is the job folder itself. This can always be located using the job directory ${JobDir} scripting variable. See Using scripting variables for more information on using ePublisher AutoMap scripting variables.
The first example is trivial and 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.
This example will create a simple “mini-report” inside the log file for each target in the job. It is a simple example demonstrating 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.
In fact, the scripting capabilities in the Documents panel are not limited to checking files out of a revision control system. The only requirement is that FileList.txt includes a list of file paths of files to be included. You may access the FileList.txt file and the path to it using the ePublisher AutoMap ${FileListName} and ${FileListPath} scripting variables accordingly. For more information on ePublisher AutoMap scripting variables, see Using scripting variables.
The following script example calls getfilesaction_cvs.vbs which is installed as part of the ePublisher AutoMap installation. By default, this script is located in the follow path:
\Program Files\WebWorks\ePublisher AutoMap\Scripts\getfilesaction_cvs.vbs
getfilesaction_cvs.vbs 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 “as is” but is a starting point including everything necessary to set up a working script for your particular environment.
The getfilesaction_cvs.vbs script is completely documented and can be followed by someone who has scripting experience. Again, it is only a starting point. Minimally, you will need to set the CVS attributes for your user name, server name, and type of authentication, and adjust for how CVS is installed and called on your system. These areas of the script are highlighted below:
Below is a screenshot showing an example call of 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 FileList.txt. That file list is then used for the AutoMap job conversion.
The following is a summary of the available script variables.