Change paragraph style option for all paragraph styles

Explorer ,
Jun 30, 2019 Jun 30, 2019

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".

Capture.JPG

regards.

TOPICS
Scripting

Views

364

Likes

translate

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

Most Valuable Participant , Jun 30, 2019 Jun 30, 2019
Loop over every style using the script developed in this thread: Detailed font change in paragraph stylesAs 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.htmlThe top property is "alignToBaseline", and if you might have changed something to First Line Only, set gridAlignFirstLineOnly to false as well.

Likes

translate

Translate

Translate
Most Valuable Participant ,
Jun 30, 2019 Jun 30, 2019

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.

Likes

translate

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
Explorer ,
Jun 30, 2019 Jun 30, 2019

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;

}

Likes

translate

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
New Here ,
Jan 03, 2021 Jan 03, 2021

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

Likes

translate

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
New Here ,
Jan 03, 2021 Jan 03, 2021

Copy link to clipboard

Copied

i want to check whether "align to grid"options enable or not for all paragraph styles in my document

Likes

translate

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
New Here ,
Jan 03, 2021 Jan 03, 2021

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

Likes

translate

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