🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1963

Re: Import XML [JS]

#1963
From: loic_aigon
Date: Thu, 22 Jan 2009 08:20
14 lines
1029 bytes
Hi
I use this approach but they may be a better way :

var myXMLFolder = File(myXML).parent;
var myXMLName = myXML.name;
...
if(app.activeDocument.saved == false)
{
app.activeDocument.save(new File(myXMLFolder+"/"+myXMLName.split(".xml")[0]+".indd"));
}

//myXMLName.split(".xml")[0] return first part of the name
//I can't do myXML.split(".xml") so I had to reconstruct the path
//Hence I needed to know the file parent folder.
Technical Details
Message-ID: <59b7926b.3@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
References: <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: loic_aigon <loic_aigon@yahoo.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Import XML [JS]
Message-ID: <59b7926b.3@webcrossing.la2eafNXanI>
Date: Thu, 22 Jan 2009 00:20:12 -0800
References: <59b7926b.-1@webcrossing.la2eafNXanI>
Lines: 15
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit