Moved to InDesign Scripting
Sorry I should of been more specific. What we are really trying to achieve, is that we have a script that changes leading based on user selection with mouse and input into a dialog for size. But currently the user can only change leading for textframe one at a time.....We have two textframes side by side english, french.
We are trying to find a way to do both simultaneously. Unfortunately you cant highlight and select over into two seperate textframes. Hence this script. We thought by identifying the index number of the starting and ending paragraphs we could achieve this. But we realised that paragraphs with no printable characters is also being counted which causes problems.
But currently non printable characters are being counted even in empty paragraphs. This ultimately results in different index locations of start and ending paragraphs for both textframes.
Maybe you know of a better way to achieve simultaneous leading of two textframes?
Here is a short test sample we've been using giving us exact location of non printable characters.
str = StringUtils.replaceAll(str,"\r","");
str = StringUtils.replaceAll(str,"\n","");
str = StringUtils.removeExtraSpaces(str,true,true,true);
var t = app.selection.paragraphs.contents;