Change Manual hyphen into Discretionary Hyphen
hi all,
requirement:
i want change manual hyphen @ end of line discretionary hyphen in emails etc.....
using below script change manual hyphen discretionary hyphen, throughout document. [note: not in end of line alone]
//change throughout document script
var mydocument = app.activedocument
app.findtextpreferences.findwhat = nothingenum.nothing
app.changetextpreferences.changeto = nothingenum.nothing
app.findtextpreferences.appliedcharacterstyle = "aaa"
app.findtextpreferences.findwhat = "-"
app.changetextpreferences.changeto = "" //within double quotes discretionary hyphen there
app.activedocument.changetext()
app.findtextpreferences.findwhat = nothingenum.nothing
app.changetextpreferences.changeto = nothingenum.nothing
above script works properly
finally got relavant script forum regards checking lines after try tuned script. dont know want do.
var mydocument = app.activedocument;
var myline = mydocument.stories.everyitem().lines.everyitem().getelements();
for(i=0; i<myline.length; i++)
{
var myhyphen = myline[i].texts[-1].hyphenatelastword(true)
// dont know
//
}
}
please can give solution. dont know how script using discretionary hyphen.
thanks in advance
beginner
hi,
modify alike:
for (i = 0; < myline.length; ++)
if (myline[i].characters[-1].contents == "-")
myline[i].characters[-1].contents = specialcharacters.discretionary_hyphen;
the problem if story uses paragraph text composer, of manual "-" pushed end of line , stay untouched
rgds
More discussions in InDesign Scripting
adobe
Comments
Post a Comment