• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to set the Publish variables using an script (ExtendScript)

Contributor ,
Aug 25, 2020 Aug 25, 2020

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;
}

TOPICS
Publishing , Scripting , Structured

Views

120

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation