turn hyphenation on by script
- This topic has 2 replies, 2 voices, and was last updated 5 years, 9 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / turn hyphenation on by script
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / turn hyphenation on by script
Tagged: hyphenation, Layers, Scripting
I have a 1700 pages indesign layout with two language layers based on the same style. The style has hyphenation on but now I have to turn hyphenation off in all text IN ONLY ONE LAYER. This script:
app.documents[0].stories.everyItem().hyphenation=false;
does the trick, but for all text in the book (both layers). Is there a way to confine the trick to work only on text in the layer “UKtext”?
Jens
You can try this, but note, it will cause overrides and if you have storys with linked frames over multiple layers, it will turn the hyphenation off on other layers too.
var s = app.activeDocument.layers.itemByName("layer name").textFrames.everyItem().parentStory; for (var i = 0; i < s.length; i++) { s[i].hyphenation = false; }
So I would vote for a new style with correct language and maybe hyphenation turned on?!
Kai
It worked! Super and thanks! This saved me for going into more than 3000 text boxes to change the setting :-)
Jens
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!