Copy link to clipboard
Copied
Hi guys,
How can i change an item in paragraph style option, not just for one paragraph style but for all paragraph styles in the document.
for example:
i want to set "align to grid" for all paragraph styles in my document to "none".
regards.
1 Correct answer
Loop over every style using the script developed in this thread: Detailed font change in paragraph styles
As it is, it changes the font, so check the documentation for what property you want to change: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ParagraphStyle.html
The top property is "alignToBaseline", and if you might have changed something to First Line Only, set gridAlignFirstLineOnly to false as well.
Copy link to clipboard
Copied
Loop over every style using the script developed in this thread: Detailed font change in paragraph styles
As it is, it changes the font, so check the documentation for what property you want to change: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ParagraphStyle.html
The top property is "alignToBaseline", and if you might have changed something to First Line Only, set gridAlignFirstLineOnly to false as well.
Copy link to clipboard
Copied
thank you..
this is my code:
for (var i=2; i<app.activeDocument.paragraphStyles.length; i++)
{
app.activeDocument.paragraphStyles.gridAlignment = GridAlignment.NONE;
}
Copy link to clipboard
Copied
Hi Sayed,
i want to check whether "align to grid"options enable or not for all paragraph styles in my document
Copy link to clipboard
Copied
i want to check whether "align to grid"options enable or not for all paragraph styles in my document
Copy link to clipboard
Copied
Hi,
How to check "Align To Grid" options used in paragraphStyles.
How to use "gridAlignment" property.
var myDoc =app.activeDocument
for(var ps=2;ps<myDoc.paragraphStyles.length;ps++){
if(myDoc.paragraphStyles[ps].gridAlignment!=1852796517){ //GridAlignment.NONE
alert(myDoc.paragraphStyles[ps].name);
}
}
I used like this but i get an error. Please mention how to use "gridAlignment" in paragraph Style

