Participant
January 29, 2025
Answered
Hyphenation Settings slider
- January 29, 2025
- 1 reply
- 565 views
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.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.