Insert the line break in end of the all lines in the paragraph
hi all,
i want insert line break in end of lines in paragraph javascript.
rohit
hi!
this might of help:
http://in-tools.com/article/scripts-blog/freeze-composition/
also ancient script wrote:
function isletter(str) { return /^[a-z\u00c0-\u00ff]$/i.test(str); } function isbreak(str) { return /^[\u0021\u0022\u0023\u0025\u0026\u0027\u0028\u0029\u002a\u002c\u002d\u002e\u002f\u003a\u003b\u003f\u0040\u005b\u005c\u005d\u005f\u007b\u007d\u00a1\u00ab\u00b7\u00bb\u00bf\u037e\u0387\u055a\u055b\u058a\u05c3\u05f3\u05f4\u060c\u061b\u066a\u1806\u1808\u1809\u2010\u2011\u2012\u2013\u2014\u2015\u2018\u2019\u201a\u201b\u201c\u201d\u201e\u201f\u2032\u2033\u2034\u2035\u2036\u2037\u2039\u203a\uff01\uff02\uff03\uff05\uff06\uff07\uff08\uff09\uff0a\uff0c\uff0d\uff0e\uff0f\uff1a\uff1b\uff1f\uff20\uff3b\uff3c\uff3d\uff3f\uff5b\uff5d\uff65\d ]$/i.test(str); } function breakstory(mystory) { (a=mystory.lines.length-1;a>=+0; a--) { if (mystory.lines[a].characters.item(-1).isvalid) { if (isbreak(mystory.lines[a].characters.lastitem().contents)) mystory.lines[a].insertionpoints[-1].contents = '\n'; if (isletter(mystory.lines[a].characters.lastitem().contents) || mystory.lines[a].characters.lastitem().contents==specialcharacters.discretionary_hyphen) mystory.lines[a].insertionpoints[-1].contents = '-\n'; // else $.writeln(app.selection[0].lines[a].characters.item(-1).contents) }} } ( i=app.activedocument.stories.length-1;i>=0; i--){ breakstory (app.activedocument.stories.item(i))}
More discussions in InDesign Scripting
adobe
Comments
Post a Comment