Article View: adobe.scripting.indesign
Article #18207Script to export stories as XML and obtain external attributes
From: James Naylor
Date: Tue, 08 Apr 2003 19:01
Date: Tue, 08 Apr 2003 19:01
27 lines
1769 bytes
1769 bytes
Hello people! I have been having lots of fun learning to script InDesign, especially using the assistance of these (and a couple of other) messageboards! I have hit a bit of a problem with my script, which is an attempt to archive out text as xml, after grabbing some attributes from an external text file. I have managed to get the attributes from the text file into the XML elements, but am trying to get the script to loop through and run on each body tag only! However (see the excerpt of the script in the following post), when I have the line: if name of markup tag of myXMLElement is "Story" then the attributes get posted to each Story tag. If I change Story to body, the script errors. Any ideas how I can get the script to work so that for each "body" element the script will parse the jt file and write the elements, then move on the next body element and ignore all the others? The current structure is: Root --->Story -------->body --->Story -------->headline etc. Post questions, if I haven't made it clear!
Technical Details
Message-ID:
<1de8a6c0.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,82ec3cb55652c142 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-04-08 12:08:07 PST From: "James Naylor" <james.naylor@rbi.co.uk> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Script to export stories as XML and obtain external attributes Message-ID: <1de8a6c0.-1@WebX.la2eafNXanI> Date: Tue, 8 Apr 2003 12:01:05 -0700 Lines: 35 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit