Article View: adobe.scripting.indesign
Article #1958Re: Import XML [JS]
From: rajeevkumar
Date: Thu, 22 Jan 2009 04:38
Date: Thu, 22 Jan 2009 04:38
17 lines
1335 bytes
1335 bytes
Hi All,
Thanks, I have already done that. Now I want to save InDesign document. at present if I am saving the file then it shows .xml.indd I want to remove .xml from the file name while saving.
var FilterID = "InDesign Template: *.indt";
var FilterXML = "XML File: *.xml";
var myFile = File.openDialog("Please choose InDesign Template", FilterID);//To choose InDesign template
var myXML = File.openDialog("Please choose XML File", FilterXML);
var myXMLName = myXML.fielName;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
var myDoc = app.open(myFile);
myDoc.xmlElements.item(0).importXML(File(myXML));
if(app.activeDocument.saved == false)
{
app.activeDocument.save(new File(myXML+".indd"));
}
Technical Details
Message-ID:
<59b7926b.2@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b7926b.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,2939f3e6cb46761a X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: rajeevkumar <rajeev_kumar_sinha2005@yahoo.co.in> Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Import XML [JS] Message-ID: <59b7926b.2@webcrossing.la2eafNXanI> Date: Wed, 21 Jan 2009 20:38:51 -0800 References: <59b7926b.-1@webcrossing.la2eafNXanI> Lines: 21 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit