Skip to main content
Inspiring
September 1, 2017
Answered

Remove hyphenate throughout the file

  • September 1, 2017
  • 3 replies
  • 28873 views

my file is of around 50 pages and it contains lots of text boxes with hyphenate option ON, is there way or script to remove hyphenate throughout the file at once...

thanks in advance

    This topic has been closed for replies.
    Correct answer winterm

    This jsx script turns off hyphenation in an active document, also modifies Paragraph styles accordingly. The code isn't mine, sorry, couldn't detect original author now...

    Application.prototype.main=function()

    {

    if(this.documents.length>0)

    {

    var doc= this.activeDocument;

    doc.stories.everyItem().hyphenation=false;

    var paraSt = doc.paragraphStyles.everyItem().getElements();

    for(var i=0; i<paraSt.length; i++)

    {

    if(paraSt.name.indexOf("[")==-1)

    {

    paraSt.hyphenation=false;

    }

    }

    }

    }

    app.main();

    alert("Hyphens removed!");

    3 replies

    amaarora
    Inspiring
    September 1, 2017

    Hi,

    Open paragraph panel from Type menu.. you will see the hyphenate option at the bottom of the panel. Turn it off. This Will override the style definations for the paragraphs.

    If you have defined different paragraph styles in your document then you will need to edit each style(double click on the style name to open the dialog box) and turn off the hypenation.

    -Aman

    winterm
    Legend
    September 1, 2017

    Yeah, that's exactly what the script does... in one click and even less seconds

    Worth to bother installing if you have more than 1-2-3 para styles...

    winterm
    wintermCorrect answer
    Legend
    September 1, 2017

    This jsx script turns off hyphenation in an active document, also modifies Paragraph styles accordingly. The code isn't mine, sorry, couldn't detect original author now...

    Application.prototype.main=function()

    {

    if(this.documents.length>0)

    {

    var doc= this.activeDocument;

    doc.stories.everyItem().hyphenation=false;

    var paraSt = doc.paragraphStyles.everyItem().getElements();

    for(var i=0; i<paraSt.length; i++)

    {

    if(paraSt.name.indexOf("[")==-1)

    {

    paraSt.hyphenation=false;

    }

    }

    }

    }

    app.main();

    alert("Hyphens removed!");

    Obi-wan Kenobi
    Legend
    September 1, 2017

    Script written in March 2011 by Loic.Aigon, surely the best scripter from Toulouse, in France, I know! …

    [Hi Loïc!] 

    (^/)

    winterm
    Legend
    September 1, 2017

    Thank You, Obi-wan, I'll write it down!

    BobLevine
    Community Expert
    Community Expert
    September 1, 2017

    Did you not use paragraph styles?