Article View: adobe.scripting.indesign
Article #8232Re: Remove all styles
From: Martin Fischer*
Date: Wed, 25 Oct 2006 06:45
Date: Wed, 25 Oct 2006 06:45
31 lines
1473 bytes
1473 bytes
Hi Theresa,
you may do it like this:
with (app.activeDocument) {
if (paragraphStyles.length > 2)
paragraphStyles.itemByRange(2,-1).remove();
if (characterStyles.length > 1)
characterStyles.itemByRange(1,-1).remove();
}
But it would be recommendable not only to remove the styles but to replace them with just one basic style like this (the second paragraphstyle and the first characterstyle in the palettes will be the remaining basic styles):
with (app.activeDocument) {
if (paragraphStyles.length > 3)
paragraphStyles.itemByRange(3,-1).remove(paragraphStyles[2]);
if (characterStyles.length > 2)
characterStyles.itemByRange(2,-1).remove(characterStyles[1]);
}
Martin
Technical Details
Message-ID:
<3bc21244.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.isoc.lu!news.stben.net!webcrossingReferences:
<3bc21244.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,8ada95de2814613a X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Martin Fischer*" <martin.fischer@online.de> Newsgroups: adobe.scripting.indesign Subject: Re: Remove all styles Message-ID: <3bc21244.0@webcrossing.la2eafNXanI> Date: Tue, 24 Oct 2006 23:45:42 -0700 References: <3bc21244.-1@webcrossing.la2eafNXanI> Lines: 29 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.isoc.lu!news.stben.net!webcrossing