Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Server Developers
Viewing all articles
Browse latest Browse all 20709

TextStyleRange on content change removes style

$
0
0

HEllo

I am tryning to change  text of a textframe by changing the single styleRanges of the  textFrame. My textFrame has 4 styleRanges but when i change the text of  the first StyleRange , the textFrames counts 3 styleRanges. Why it  removes style ranges? Here is the code i try on Extende Script editor:

var box=layer.textFrames[2];

var styles=box.textStyleRanges;//styles.length=4

 

var s1=styles[0].contents;//ok
var s2=styles[1].contents;//ok
var s3=styles[2].contents;//ok
var s4=styles[3].contents;//ok
*/
var s1=styles[0].contents="somtext\rsomtext\rsomtext (somtext)\r";//this change merges styles[0]  and styles[1] in one

 

var styles=box.textStyleRanges;//styles.length=3
var s1=styles[0].contents;//ok
var s2=styles[1].contents;//ok
var s3=styles[2].contents;//ok
var s4=styles[3].contents;//error dont exists

 

It seems that the change of the text  merge styleRange1 and styleRange2. Any one know why??? Any help?

Thanks


Viewing all articles
Browse latest Browse all 20709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>