• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

1.1K

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

Community Expert , Jun 30, 2019 Jun 30, 2019

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.

Votes

Translate

Translate
Community Expert ,
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.

Votes

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;

}

Votes

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

Votes

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

Votes

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

LATEST

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

Votes

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