Writing XML Object to a File
Hi, I am using InDesign JavaScript to make an XML object in memory. When my script is done, I want to write the XML to a file. When I run the code below, the file is created, but the XML is not written to the file. Any help would be appreciated. Thanks. Rick
#target indesign
var partsMap = <partsMap />;
savePartsMap (partsMap);
function savePartsMap (partsMap) {
var partsFile;
// Make a File object for the parts map XML file.
partsFile = new File("E:\\Test.xml");
// Open the map file.
partsFile.open("w");
partsFile.write(partsMap);
partsFile.close();
}
