1 person found this helpful
modify this alike:
for (i = 0; i < myLine.length; i ++)
if (myLine[i].characters[-1].contents == "-")
myLine[i].characters[-1].contents = SpecialCharacters.DISCRETIONARY_HYPHEN;
The problem is that if your story uses paragraph text composer, some of manual "-" could be pushed from the end of line and they would stay untouched
Thanks for your reply....
Its very helpful answers for me. Later i try and create the code and it works fine for me.
var myDocument = app.activeDocument
app.findTextPreferences.appliedCharacterStyle = "Email"
app.findTextPreferences.findWhat = "-"
var myFoundItems = myDocument.findText(true)
for(i=0; i<myFoundItems.length; i++)
if(myFoundItems[i].lines.characters[-1].contents == "-")
myFoundItems[i].lines.characters[-1].contents = SpecialCharacters.DISCRETIONARY_HYPHEN
Again thanks a lot....
I changed all manual hyphen at the end of line into Discretionary Hyphen using above script.
Is it possible to avoid reflow after change manual hyphen into discretionary hyphen?
[Note: Want line end as it is in the previous stage]
What i am trying is, use shift return after discretionary hyphen. No reflow but the discretionary hyphen is missing. So no use of it.
Before running script my file is:
After running the script my file get reflow in that paragraph. See my file below
Any solution to avoid reflow within the paragraph using indesign or indesing scripting.
Thanks to all forum members
That's just the way a discretionary hyphen works. If it occurs near the end of a line and it's within the hyphenation limit, it will hyphenate there. If not, it won't.
Thanks for your reply...
Atleast is it possible in script, to want line end as it is in previous stage after change manual hyphen in discretionary hyphen.
Thanks in advance
If you don't want text to reflow ==> leave manual hyphen (no matter if you replace them)
Otherwise you are runing in circles