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
any hint please
Cheers
Suzan
Hi Suzan,
You could work a little with this:
ruleAboveLeftIndent
ruleAboveRightIndent
ruleBelowLeftIndent
ruleBelowRightIndent
See: InDesign ExtendScript API (11.0)
(^/)
Copy link to clipboard
Copied
Hi Suzan,
You could work a little with this:
ruleAboveLeftIndent
ruleAboveRightIndent
ruleBelowLeftIndent
ruleBelowRightIndent
See: InDesign ExtendScript API (11.0)
(^/)
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
Copy link to clipboard
Copied
many thanks to you Obi my dear, i did it and worked well
Best Regards
Suzan
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;
}
(^/)
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
Copy link to clipboard
Copied
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:
2/ After mine, the 4 paras have been treated, but overridden:
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:
(^/)