turn hyphenation on by script

Viewing 2 reply threads
  • Author
    Posts
    • #104917

      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

    • #104930

      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

    • #104931

      It worked! Super and thanks! This saved me for going into more than 3000 text boxes to change the setting :-)

      Jens

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
>