Replacing based on style
Hello,
I have a series of documents in which a number of stylesheets are based on "Basic Paragraph". I want to change them all to be based on No Paragraph Style. The script below targets the correct folder (Fonts, within General), but there is something wrong with my syntax in the loop (line 15).
Thanks in advance for any help with this.
Tim
var myDoc = app.activeDocument;
var theseStyles = myDoc.paragraphStyleGroups.itemByName ("General");
var targetStyles = theseStyles.paragraphStyleGroups.itemByName("Fonts");
var numberStyles = targetStyles.allParagraphStyles.length;
alert(numberStyles);
for (var i = 0; i<numberStyles; i++){
var currentStyle = targetStyles.allParagraphStyles;
if (currentStyle.basedOn = "Basic Paragraph"){
currentStyle.basedOn = "No Paragraph Style";
}
}