This content has been marked as final. Show 3 replies
Hi charles darwin,
What you want to find is an XML element given its XML tag, then change something in the text content of the element. But it's hard to know exactly how to do that if we don't know anything about the structure of your XML. It could be really simple, and it could be really hard. Tell us more!
Also, I love your work. "The Origin of Species" is one of my favorite works. But...aren't you a little, er, dead? I mean, one is never too old to learn InDesign....
hi ole, <br />i'm back to republish my "The Origin of Species" using indesign. just kidding.<br /><br />The serious part is i have this simple structure:<br /><ref>1</ref><br /><ref>2</ref><br /><ref>3</ref><br /><br />then the author decided that he wants the ref1 to become ref2 and then ref3 to become ref1. is there a script that could find the tag <ref> containing "1" and replace it with "2" in all the citations in the body?<br /><br />i have a meeting with my boss and he will ask me regarding this so please your help would be highly appreciated.
i found this script from Peter Kahrel
if ( app.selection.constructor.name == 'InsertionPoint'
&& app.activeDocument.characterStyles.item ('ref') != null )
app.selection.appliedCharacterStyle = 'ref';
app.selection.contents = '1'
since my xml tag was mapped with my character style. i could just find the character style (ref) containing '1' and replace it with '2'. can you help me improve this script?