🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17735

Re: Reference XML Element of a Story

#17735
From: James Naylor
Date: Tue, 20 May 2003 16:47
26 lines
2180 bytes
Olav,

first off - don't worry about the terseness of the reply (I never even noticed...), was I not providing enough info in the question? Regardless, I would like to state how much I appreciate your help and that of the other forum visitors from saving my sanity!

Back to the problem at hand - I can't seem to get the "associated XML Element" property to return anything useful. I am basically running through the stories on the page, using this:

repeat with myCounter from 1 to (count stories of myDocument)

and then, a bit later on in the script, I need to access the associated XML Element (all the frames have been tagged using the 'map styles to tags' command) to write some attributes.

However, I am using the following to try and get the id of the xml element that is associated with the text frame that holds the story:

display dialog "this story has text frames with associated xml element ids of " & ((get id of associated XML elements of text frame 1 of story myCounter of myDocument))

but that just returns an error of:
InDesign 2.0.2 got an error: Can't get id of associated XML elements of text frame 1 of story 13 of document "CJOU0514p006".

Any idea where I am going wrong?

Once I have the xml element id, i am then going to try and write some attributes using:
tell XML Element selectedXMLElement to make XML Attribute with properties {name:"author", value:authorName}
does that make sense?

Cheers,

James
Technical Details
Message-ID: <1de92d44.3@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de92d44.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,3cfe9ba1928a7718
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-20 10:08:37 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-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Reference XML Element of a Story
Message-ID: <1de92d44.3@WebX.la2eafNXanI>
Date: Tue, 20 May 2003 09:47:54 -0700
References: <1de92d44.-1@WebX.la2eafNXanI>
Lines: 39
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit