Skip to main content
Participating Frequently
June 9, 2020
Answered

How "Not to Select" line break with triple click?

  • June 9, 2020
  • 1 reply
  • 2585 views

I have a huge amount of copy-and-paste text with headings, paragraphs and different styles. I'm selecting a line of text with triple click. It works ok but it also selects the invisible line break character at the end of the line. So when i paste new text over the selected one the following text comes at the end of it and i have to hit enter every time to put it back to where it was.

Is there a way "not to select" the line break character with triple click?

 

This topic has been closed for replies.
Correct answer FRIdNGE

Using a KB shortcut associated to something "simplistic" like that to select, placing the cursor in text, all the para without the carriage-return! …  😉

 

// by FRIdNGE, Michel Allio [09/06/20]
var ip = app.selection[0].paragraphs[0].insertionPoints;
if ( app.selection[0].paragraphs[0].characters[-1].contents == "\r" ) ip.itemByRange(0,-2).select();
else ip.itemByRange(0,-1).select();

 

(^/)  The Jedi

 

1 reply

FRIdNGE
FRIdNGECorrect answer
June 9, 2020

Using a KB shortcut associated to something "simplistic" like that to select, placing the cursor in text, all the para without the carriage-return! …  😉

 

// by FRIdNGE, Michel Allio [09/06/20]
var ip = app.selection[0].paragraphs[0].insertionPoints;
if ( app.selection[0].paragraphs[0].characters[-1].contents == "\r" ) ip.itemByRange(0,-2).select();
else ip.itemByRange(0,-1).select();

 

(^/)  The Jedi

 

YogeshSimpson
Participant
December 30, 2020

Hey there, sorry in advance for the dumb question. Where do enter this magical bit of code? I'd love to be able to triple click without selecting the paragraph break at the end of the line. Thanks.

YogeshSimpson
Participant
December 30, 2020

Did you try to restart InDesign, i forgot to mention that.


Yep, tried that. I can see my file in the Scripts panel in indd, but it has the little i next to it instead of the javascript icon, and when I hover over it I get: "This file is not executable by any supported script language."

I tried re-pasting the code and made sure it was identical, but still no dice? I used the same naming convention as the other script files as well?