Copy link to clipboard
Copied
Try this :
var doc = app.activeDocument;
var pStyleNames = ["PN", "PT", "CN", "CT", "S1", "S1-S2", "S2", "S2-S3", "S3", "S3-S4", "S4"];
for(var i = 0; i < pStyleNames.length; i++){
if(doc.paragraphStyles.itemByName(pStyleNames[i]).isValid){
styleUpdate(doc.paragraphStyles.itemByName(pStyleNames[i]));
}
}
//===========================
function styleUpdate(myPstyle){
myPstyle.keepAllLinesTogether = true
myPstyle.keepLinesTogether = false;
myPstyle.keepFirstLines
...
Copy link to clipboard
Copied
Try this :
var doc = app.activeDocument;
var pStyleNames = ["PN", "PT", "CN", "CT", "S1", "S1-S2", "S2", "S2-S3", "S3", "S3-S4", "S4"];
for(var i = 0; i < pStyleNames.length; i++){
if(doc.paragraphStyles.itemByName(pStyleNames[i]).isValid){
styleUpdate(doc.paragraphStyles.itemByName(pStyleNames[i]));
}
}
//===========================
function styleUpdate(myPstyle){
myPstyle.keepAllLinesTogether = true
myPstyle.keepLinesTogether = false;
myPstyle.keepFirstLines = 2;
myPstyle.keepLastLines = 2;
myPstyle.keepWithNext = 2;
myPstyle.startParagraph = StartParagraph.ANYWHERE;
myPstyle.hyphenation= false;
}
//===========================
Sunil