Copy link to clipboard
Copied
You're looking for "hyphenWeight".
I can't tell you exactly how you can use it without knowing more about what you're trying to do. But, for example, imagine you had dozens of paragraph styles to edit, and you didn't want to have to click around manually like some pixel-stained technopeasant wretch. You might want to write a script to e.g. step through all your paragraph styles and slam the slider to "Better Spacing" in all of 'em. You'd want to loop through all paragraph styles, except that I
...Copy link to clipboard
Copied
It is part of the paragraph styles? Why scripting? Adust and work with paragraph sryles.
Copy link to clipboard
Copied
Thanks. I know it's part of the paragraph styles but for my purpose I need to access that via scripting.
Copy link to clipboard
Copied
You're looking for "hyphenWeight".
I can't tell you exactly how you can use it without knowing more about what you're trying to do. But, for example, imagine you had dozens of paragraph styles to edit, and you didn't want to have to click around manually like some pixel-stained technopeasant wretch. You might want to write a script to e.g. step through all your paragraph styles and slam the slider to "Better Spacing" in all of 'em. You'd want to loop through all paragraph styles, except that I assume you wouldn't want to touch paragraph style 0 (that's "No Paragraph Style") and paragraph style 1 (that's "[Basic Paragraph Style]").
So your script would look like this:
for (i=2; i < document.allParagraphStyles.length; i++) {
document.allParagraphStyles[i].hyphenWeight = 0
}
If you wanted the slider at the other end ("Fewer Hyphens") then you'd want to set hyphenWeight to 10.
You can find hyphenWeight in a lot of places besides allParagraphStyles; I'd suggest that you search someplace like indesignjs.de/extendscriptAPI/indesign-latest/, and see which object(s) are most applicable to your situation.
Copy link to clipboard
Copied
That's the one. Thanks a lot Joel!