Turn off hyphenation except in stories that contain hyphenated words
Hi everyone,
Is it possible to adapt the script below, so that it turns off hyphenation except for stories that contain hyphenated words? Basically, if all the story in a text frame is hyphenated (true), the script should turn it off (false) and ignore those text frames that contain hyphenated words.
var doc = app.activeDocument;
var stories = app.activeDocument.stories.everyItem().texts[0].hyphenation = false;
try{
var stories = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().paragraphs.everyItem().hyphenation = false;
}catch(e){}
var PStyle = app.activeDocument.allParagraphStyles;
for ( p = 1; p < PStyle.length; p++) PStyle
.hyphenation = false;
Thanks in advance,
Rogerio
