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

//  

        }

    }

   

 

screen shot 2013-01-03 @ 6.12.57 pm.png

 

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

Popular posts from this blog

Warning, the Safe Path is not accessible vm3 - Joomla! Forum - community, help and support

uppercase letters in url - Joomla! Forum - community, help and support

Joomla! Update is not offering Joomla 3 - Joomla! Forum - community, help and support