Copy link to clipboard
Copied
I am trying to create my first script using the ExtendScript tool in order to publish my DITA bookmaps automatically (without the need to set the stuff in the UI).
The script can successfully open the corresponding bookmap in FrameMaker 2020. However, the Publish variables such as the Settings Files, Output folder as well as the Ditaval file are not updated based on the script. The Publish pod simply shows the previously defined seetings etc. In order to call the publisher I used the sample script from the following link.
How to access the Publisher module
Could anyone please help me get that right?
Here is the main function:
function publishIFU(scanner, language, outputType)
{
var mainPath, ifuFile, settingsFile, ditavalFile;
var outputFolder;
mainPath = getMainPath(scanner, language);
ifuFile = getIFUFile(mainPath, scanner, language);
settingsFile = getSettingsFile(mainPath, scanner, language);
ditavalFile = getDitavalFile(mainPath, scanner);
outputFolder = mainPath+"/output";
SimpleOpen(ifuFile,false);
SetSts(settingsFile);
SetOutputFolder(outputFolder);
SetOutputType(outputType);
}
And the functions I use to set the Publish variables:
function SetSts(stsFile)
{
var strCommand="SetMCPSetting "+ stsFile ;
var ret=CallClient ("FMPublisher", strCommand );
return ret;
}
function SetOutputFolder(outputFolder)
{
var strCommand="SetOutputLocation"+ outputFolder;
var ret=CallClient ("FMPublisher", strCommand );
return ret;
}
function SetOutputType(outputType)
{
strCommand="MCPPublish"+outputType ;
var ret=CallClient ("FMPublisher", strCommand);
return ret;
}
Have something to add?