Question
Contents getting selected from Different XMLElements from TextStyleRanges.

I have created 3 xmlElements inside the story. All three have same paragraph style.
// Just a dummy script for demo.
if (app.selection.length > 0) {
// Get the selected item
var selectedItem = app.selection[0];
var test = 0;
...
}
In debugger,
selectedItem.textStyleRanges.length
1
selectedItem.textStyleRanges[0].contents
paragraph 1
paragraph 2
paragraph 3
What I want is since I selected 1st tag(1st xmlElement with content paragraph 1) only that should have displayed on debug console.
I need all the different style ranges and contents from perticular xmlElement and not the contents from neighbouring xmlElements I know textStyleRanges returns that. But is there a way to do what I want?
I need all the different style ranges and contents from perticular xmlElement and not the contents from neighbouring xmlElements I know textStyleRanges returns that. But is there a way to do what I want?
