Article View: adobe.scripting.indesign
Article #8084untag untags too much
From: Scott25
Date: Fri, 03 Nov 2006 21:37
Date: Fri, 03 Nov 2006 21:37
21 lines
1096 bytes
1096 bytes
The following JS, intended to untag <typeset_char_space> is also untagging all of the child elements of <typeset_char_space>. Is there any way to prevent this?
Thanks.
if (app.documents.length != 0) {
var myTagToUntag = 'typeset_char_space';
untagxmlelement(app.activeDocument);
}
function untagxmlelement(elm) {
var i;
for (i = 0; i < elm.xmlElements.length; i++) {
if ( elm.xmlElements[i].markupTag.name == myTagToUntag ) {
elm.xmlElements[i].untag();
i--;
} else {
untagxmlelement(elm.xmlElements[i]);
}
}
}
Technical Details
Message-ID:
<3bc22c96.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.isoc.lu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,b9c8bbaf8da8c807 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Scott25@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: untag untags too much Message-ID: <3bc22c96.-1@webcrossing.la2eafNXanI> Date: Fri, 3 Nov 2006 13:37:39 -0800 Lines: 23 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit