Hi all,
I want to selecting the two character style contents, they should appear with one following the other on the same line or Multiline. I used the findText() to find the first character style text, then im stuggle in how to concatenate founded items with following text with specific character style.
Thanks in advance for helping hands.
Regards,
Imagine.
Hi all,
I tried myself using the selection techniques, from the selected text i will move forward by character by character, If that text end with specified character style means i will print that selection[0] text.
I know the selection programs having the performance issues. so that it takes long time for processing the outputs if the document having much pages.
var myLocalSelection = app.selection[0];
while (myLocalSelection.characters.nextItem(myLocalSelection.characters[-1] ).isValid == true ) {
if (myLocalSelection.characters.nextItem(myLocalSelection.characters[-1] ).contents == " ") {
myLocalSelection.characters.nextItem(myLocalSelection.characters[-1]) .select(SelectionOptions.ADD_TO);
myLocalSelection = app.selection[0];
//LastCharIndex +=1;
//LastTargetIndex +=1;
}
else if (myLocalSelection.characters.nextItem(myLocalSelection.characters[-1] ).contents == "\u000D") {
break;
}
else if (myLocalSelection.characters.nextItem(myLocalSelection.characters[-1] ).appliedCharacterStyle.name.indexOf ("_Highlighted_phrase_1") != -1) {
myLocalSelection.characters.nextItem(myLocalSelection.characters[-1]) .select(SelectionOptions.ADD_TO);
myLocalSelection = app.selection[0];
//LastTargetIndex +=1;
}
else if (myLocalSelection.characters.nextItem(myLocalSelection.characters[-1] ).appliedCharacterStyle.name.indexOf ("_Highlighted_phrase_2") != -1) {
myLocalSelection.characters.nextItem(myLocalSelection.characters[-1]) .select(SelectionOptions.ADD_TO);
myLocalSelection = app.selection[0];
//LastTargetIndex +=1;
}
else if (myLocalSelection.characters.nextItem(myLocalSelection.characters[-1] ).appliedCharacterStyle.name.indexOf ("_Highlighted_phrase_2") == -1) {
break;
}
} // end of While loop
The same to be possible in without selection methoed means please give the solution or guidelines
Using InDesign CS5.5/ Windows 7
Thanks in advance for helping hands.
Regards,
Imagine
North America
Europe, Middle East and Africa
Asia Pacific