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

paragraph rules

Participant ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Hi all,

kindly i'm asking about who to reverse " paragraph rules" values for (Right/Left indent) as shown:

for ex, Left indent = 1 and Right indent = 3 then after script be reversed Left = 3 and Right = 1 and i hope that go through all paragraph styles and non styles text too

with Rule above or below

1.png

any hint please

Cheers

Suzan

TOPICS
Scripting

Views

1.9K

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

LEGEND , Nov 16, 2016 Nov 16, 2016

Hi Suzan,

You could work a little with this:

ruleAboveLeftIndent

ruleAboveRightIndent

ruleBelowLeftIndent

ruleBelowRightIndent

See:  InDesign ExtendScript API (11.0)

(^/)

Votes

Translate

Translate
LEGEND ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Hi Suzan,

You could work a little with this:

ruleAboveLeftIndent

ruleAboveRightIndent

ruleBelowLeftIndent

ruleBelowRightIndent

See:  InDesign ExtendScript API (11.0)

(^/)

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
Participant ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Hi Obi,

Thanks for your reply, i will try to find it out using your hint and i hope i get it fast, if don't i will be grateful to back to you again

Cheers

Suzan

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
Participant ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

many thanks to you Obi my dear, i did it and worked well

Best Regards

Suzan

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
LEGEND ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Something simply like this:

myParas = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements(); 

for (P = 0; P < myParas.length; P++) 

    var AL = myParas

.ruleAboveLeftIndent; 

    var AR = myParas

.ruleAboveRightIndent;

    var BL = myParas

.ruleBelowLeftIndent; 

    var BR = myParas

.ruleBelowRightIndent;

    myParas

.ruleAboveLeftIndent = AR;

    myParas

.ruleAboveRightIndent = AL;

    myParas

.ruleBelowLeftIndent = BR;

    myParas

.ruleBelowRightIndent = BL;

}

(^/) 

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
Participant ,
Nov 16, 2016 Nov 16, 2016

Copy link to clipboard

Copied

Hi Obi,

well i tried your code but nothing changed for each right and left indent and i see that your code make my paragraph styles seems to be override !!

i wrote this code and seems working well for me, you can check too

var myDoc = app.activeDocument;

var myPStyle = myDoc.allParagraphStyles;

for(i=1; i<myPStyle.length; i++){

   

   

     var  ruleAboveRightIndentVal = myPStyle.ruleAboveRightIndent; 

     myPStyle.ruleAboveRightIndent = myPStyle.ruleAboveLeftIndent; 

      myPStyle.ruleAboveLeftIndent =ruleAboveRightIndentVal; 

 

  

  

  

        var  ruleBelowRightIndentVal = myPStyle.ruleBelowRightIndent; 

     myPStyle.ruleBelowRightIndent = myPStyle.ruleBelowLeftIndent; 

      myPStyle.ruleBelowLeftIndent =ruleBelowRightIndentVal; 

       }

Suzan

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
LEGEND ,
Nov 17, 2016 Nov 17, 2016

Copy link to clipboard

Copied

LATEST

Suzan,

Alas, not so simple!

Here, 4 paras: in black color, "standard" para style (no para rules in settings) but manually done ; in red color, a para style with para rules in settings, "pure" in the first para, manually modified in the second one.

1/ Before scripts:

Capture d’écran 2016-11-17 à 12.22.02.png

2/ After mine, the 4 paras have been treated, but overridden:

Capture d’écran 2016-11-17 à 12.22.26.png

3/ With yours, "black" paras no treated, first "red" para = "pure" para style ( the style has been correctly updated), second "red" para: no correct result:

Capture d’écran 2016-11-17 à 12.23.05.png

(^/)

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