Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

Automate the process of saving Framemaker documents (*.fm) as Xml Files

$
0
0

Hi,

I am new to framemaker. We have a list of Framemaker document files (*.fm files) coming  into a folder.  We need to pick up these files and convert to xml format (same as the saveAs opertion from the File menu).

 

I have written the follwing function to Save fm files to xml

 

Code to Save fm files to xml files

function saveAsXml (doc) {

   // Get required parameters for the save function.

    var params = GetSaveDefaultParams();

    var returnParamsp = new PropVals();

  

    // Replace the .fm extension with .mif.

    var saveName = doc.Name.replace (/\.[^\.\\]+$/,".xml");

  

 

    var i = GetPropIndex(params, Constants.FS_FileType);

    params[i].propVal.ival = Constants.FV_SaveFmtXml;

 

    // Save the document as XML.

    doc.Save(saveName, params, returnParamsp);

 

}

 

 

How to automate this process so that code checks -

 

1) New fm files in the folder

2) Saves the fm file as xml

3) Moves the saved fm file to a different folder

 

Thanks,

GC

 

[Message moved to Scripting Forum by moderator]


Viewing all articles
Browse latest Browse all 888

Latest Images

Trending Articles