Skip to main content
Suzan_V
Known Participant
April 7, 2016
Answered

Pharagraph style indent script

  • April 7, 2016
  • 1 reply
  • 853 views

Hello all,

are there anyway to reverse Left indent value to right indent on all paragraph styles at document as shown

Thanks in advance

This topic has been closed for replies.
Correct answer Jump_Over

Hi,

Try this:

var

    pStyles = app.activeDocument.allParagraphStyles,

    cStyle, cRightIndent;

  // jump over [None]

pStyles.shift();

  // iterate through all

  while (cStyle = pStyles.shift()) {

      cRightIndent = cStyle.rightIndent;

      cStyle.rightIndent = cStyle.leftIndent;

      cStyle.leftIndent = cRightIndent;

      }

Jarek

1 reply

Jump_Over
Jump_OverCorrect answer
Legend
April 7, 2016

Hi,

Try this:

var

    pStyles = app.activeDocument.allParagraphStyles,

    cStyle, cRightIndent;

  // jump over [None]

pStyles.shift();

  // iterate through all

  while (cStyle = pStyles.shift()) {

      cRightIndent = cStyle.rightIndent;

      cStyle.rightIndent = cStyle.leftIndent;

      cStyle.leftIndent = cRightIndent;

      }

Jarek

Suzan_V
Suzan_VAuthor
Known Participant
April 7, 2016

wow, works great

Thanks a lot dear