Skip to main content
Known Participant
August 27, 2022
Question

How to Remove Empty Line in textframe

  • August 27, 2022
  • 7 replies
  • 1465 views

How to remove the empty line for the below text frame if a line break is applied?

 

 

Here I have a Single Paragraph for which I have used a line break and here the text alignment is bottom, here I want to remove the last empty line. How can I remove the last empty line using a script?

This topic has been closed for replies.

7 replies

Community Expert
August 29, 2022

For removing FEFF special characters you can only use Text Find/Change with Find pattern:

<FEFF>

GREP Find is not able to find anything with:

\x{FEFF}

 

But first check if the special chatacters are really FEFF characters.

Select one and go to the Info panel to see the Unicode code points of the selected character(s).

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Peter Spier
Community Expert
Community Expert
August 29, 2022

Hi, Uwe.

I remember that problem now (which is why when I looked up the query it was text, not GREP).

In December of 2013 we had a very long discussion about removing these characters in a long data-merged document that was then to have the text frames stitched into a single thread. The original poster was having a problem with paragraph styles being reassigned during the process. I no longer remember the cause of the style change, but at the time you worked out a script to solve it...

Community Expert
August 29, 2022

Hi Peter,

yes, I remember this very well!

The whole thread is still available:

 

Multiple record data merge into paragraph styles-applies the wrong style
LinaD36, Nov 22, 2013
https://community.adobe.com/t5/indesign-discussions/multiple-record-data-merge-into-paragraph-styles-applies-the-wrong-style/td-p/5633549

 

However, it could be that some of the code I posted back then was damaged in October 2019 when it was moved over to this new incarnation of the Adobe InDesign User Forum.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

SA8888Author
Known Participant
August 28, 2022

Is there any solution so I can remove the last empty line? 

Here if there is a paragraph marker at the end of the line "Text3"  I can remove the last empty line, but not able to remove the line if there is a line break marker at the end of "Text3". 

Peter Spier
Community Expert
Community Expert
August 28, 2022

You can try this:

Find \n\x{FEFF}+$ and change to nothing. Do this on a copy for testing ansd removing those caracters may have unexpected consequences.

SA8888Author
Known Participant
August 28, 2022

Hi @Peter Spier  thank you for the suggestion. Can you please help  using a script.

 

Can we remove the last empty line using the textrange? 

SA8888Author
Known Participant
August 28, 2022

Anyone with the solution?

SA8888Author
Known Participant
August 28, 2022

I'm able to remove the last empty line if there is a paragraph marker at the end of "Text3", but if there is a line break marker at the end of "Text3" I'm not able to remove the last empty line. Can anyone help with the solution with a script?

SA8888Author
Known Participant
August 28, 2022

I'm able to remove the last empty line if there is a paragraph marker at the end of "Text3", but if there is a line break marker at the end of "Text3" I'm not able to remove the last empty line. Can anyone help with the solution with a script?

SA8888Author
Known Participant
August 28, 2022

I'm able to remove the last empty line if there is a paragraph marker at the end of "Text3", but if there is a line break marker at the end of "Text3" I'm not able to remove the last empty line. Can anyone help with the solution with a script?

Community Expert
August 27, 2022

Hi @SA8888 ,

You would remove the last line break.

But note, there is contents in the last line. A couple of special characters.

I assume they are of Unicode Code Point FEFF.

So be careful what you remove.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

SA8888Author
Known Participant
August 27, 2022

Can you help with the scripting solution?

SA8888Author
Known Participant
August 28, 2022

I'm able to remove the last empty line if there is a paragraph marker at the end of "Text3", but if there is a line break marker at the end of "Text3" I'm not able to remove the last empty line. Can anyone help with the solution with a script?