Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Get text selection and properties

$
0
0

Another oddity with textStyleRanges in a selection:

 

TextStyleRanges_AnotherOddity.png

 

So, in this example we have four GREP Styles in the paragraph style and one single character selected.
How are the bets, if I'm asking for textStyleRanges and the "contents" of that (one!) range in my selection?

 

Would the contents be

1. "b", (just the contents of the selection) or would it be

2. "bccc" (why? the textStyleRange could exceed my selection, but how?) or would it be

3. "bcccddddd"? (all the way to the end of the paragraph or beyond?)

 

The surprising answer is #2.

The contents of the one and only textStyleRange of my selection would be
"bccc"

 

So, in fact it will be include the characters b plus the three characters c.

 

After some other tests with GREP Styles it seems clear, that the range of the textStyleRange of a selection will consist of the first and the next formatting change. Doesn't make a difference: if it will be forced by a GREP Style or if the formatting will fall back to its "normal" behaviour, if the GREP Style cannot kick in any more.

 

Uwe


Viewing all articles
Browse latest Browse all 37788

Latest Images

Trending Articles



Latest Images

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