Help me in this code

Guest
Jan 21, 2021 Jan 21, 2021

Copy link to clipboard

Copied

var doc = app.activeDocument;
var myPstyle = doc.paragraphStyles.itemByName("OS1", "S1", "S2")
styleUpdate(myPstyle)
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;
}

TOPICS
Scripting

Views

70

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jan 25, 2021 Jan 25, 2021
var doc = app.activeDocument; var pStyleNames = ["OS1", "S1", "S2"]; for(var i = 0; i < pStyleNames.length; i++){ var myPstyle = doc.paragraphStyles.itemByName(pStyleNames[i]); if(myPstyle.isValid) styleUpdate(myPstyle) } function styleUpdate(myPstyle){ myPstyle.keepAllLinesTogether = true myPstyle.keepLinesTogether = false; myPstyle.keepFirstLines = 2; myPstyle.keepLastLines = 2; myPstyle.keepWithNext = 2; myPstyle.startParagraph = StartParagraph.ANYWHERE; myPstyle.hyphenation= fals...

Likes

Translate

Translate
Adobe Community Professional ,
Jan 25, 2021 Jan 25, 2021

Copy link to clipboard

Copied

LATEST
var doc = app.activeDocument;
var pStyleNames = ["OS1", "S1", "S2"];
for(var i = 0; i < pStyleNames.length; i++){
var myPstyle = doc.paragraphStyles.itemByName(pStyleNames[i]);
if(myPstyle.isValid) styleUpdate(myPstyle)
}
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;
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines