Automation

Property Mapper can be run from a script or the DITA-FMx build process.

A FrameMaker “CallClient” notification is provided for the Apply Property Map command. This can be called from various automation environments, such as ExtendScript, FrameScript, and other FDK clients.

The exact syntax for calling this command varies based on the automation environment in use, but the general concept is the same for all. First you pass the client name, typically Pubs-Tools:PropertyMapper (cased and spelled exactly as defined in the maker.ini file). Then you provide a space-delimited string consisting of the book or document ID followed by the path and name of the property map file.

If you are processing the “current” document, the ID can be omitted. The file name can use a relative or absolute path. If a relative path, it is assumed to be relative to the document being processed.

If you’re using ExtendScript, the following code will run the Apply Property Map command on the current book or document:

CallClient("Pubs-Tools:PropertyMapper", "../propmap-fra.xml");

The following code will apply the property map to the specified book ID:

CallClient("Pubs-Tools:PropertyMapper", "2345819 ../propmap-fra.xml");

If you have shared properties that are applied to multiple documents, you can apply multiple property maps to the same file if needed.

You may want to apply multiple property maps to the same file. You can do this by passing multiple map file names separated by the “^” character. For example:

CallClient("Pubs-Tools:PropertyMapper", "../propmap-colors.xml ^ ../propmap-fra.xml");

If you need to use a different map file name delimiter, specify an alternate character in the MapFileDelimChar parameter in the PropertyMapper.ini file. If you’re using this feature via the ditafmx.ini file, be sure not to use the “|” character, since that is already used as a delimiter for a different purpose.

To run this command automatically as part of the DITA-FMx book-build process, select the Run Custom Script option in the DITA-FMx Book Build Settings dialog. Enter Pubs-Tools:PropertyMapper as the Client name, then enter the path and filename of the property map(s) as the Args value. When a book is generated from a map, this client plugin will process the book files. Typically this would be set in the ditafmx-bookbuild.ini file:

[BookBuildOverrides]
...
RunScript=1
ScriptName=Pubs-Tools:PropertyMapper
ScriptArgs=../../propmap-fra.xml