- Usage of Extendscript with FM Server 10,
- significance of Post-publish command
- and QuickSets in FM Server 10.
Here we go:
How to use ExtendScript with FM Server?
Prepublish is the name given to the option of executing an extendscript as soon as FM Server opens files for publishing. To use this option one needs to needs to checkmark the “Run Pre-Publish Script” & locate the .jsx from a local/network path.
Once a script-path is provided and a task saved, this is the sequence of script execution:
- FM Server task window launches
- FM launches
- Source files are opened
- Prepublish script executes
- Publishing action takes place
- FM closes
- FM Server task window closes & logs are updated.
Lets say the created task publishes a PDF and in the same task we wish to perform this pre-publishing action: “Exclude (Generated) Files from the output PDF.”
We essentially will perform these steps in our pre-publish script (script attached):
- Find the id of the open book:
- mainbook = app.FirstOpenBook;
- Traverse all the components and find if it is a generated file:
- (optional) Do intermediate actions like SaveMIF on the book to check if the action was performed.
Here, FM Server 10 provides the capability to find the id of the book opened in invisible mode and make changes to it!
One more example of usage in FM Server could be “Produce multiple PDF outputs on the basis of Conditional tags”. Here we have a scenario in which the source book has several conditional tags applied. When the FM Server task containing the script executes then on the basis of those tags script would generate several PDF outputs. Script is Available at FM10 installation -> $FMHOME\Samples\ScriptsAndUtilities & also attached in the blog link too.
In FM Server 10, pre-publishing is much more than pre-publishing ‘only’ – one may extend pre-publish feature to cover everything via scripting that FM Server doesn’t provide ready-to-use for you i.e. it makes FM Server extensible!
How to use the Post-publish command functionality?
Post-Publish is the name given to a clean-up command that we might wish to execute towards the end of publishing. These tasks could be anything from deleting the backup files, moving the outputs to another location or launching another application. All these could be done via a single MS DOS command line statement. If one wish to perform multiple actions he could infact give the path for a .bat file that would get executed on task completion.
There are various PDF Settings that one would want to assign to FM Server task. These settings need not be set each times instead users can save these settings as QuickSets.
These are similar to the PDF quicksets. FM Server 10 can produce eight RH outputs other than PDF. Though one may provide a RH Project Template for any of these outputs but when producing JavaHelp/OracleHelp/AIR outputs providing a RH Project template (containing SSL information for the respective help) is mandatory. In a RH quick set, we can define 4 properties namely:
- RH Template – The .xpj or .mpj file of the saved RH project containing respective SSL settings
- ISF File – File that specifies the mapping of formatting of FM file when imported into RH
- Master Page File – The RH Master Page to be used for the output Help
- DitaVal file – When working with Ditamaps, one can apply a DitaVal filter onto the RH output via this file.
And these QuickSets could be used like this in the drop-down on task window thus saving time for a user:
We hope these enhancements to FM Server would make it powerful, flexible and easy to use. Do try the product and let us know your feedback/queries!
– Amit Agarwal (FrameMaker Engineering)