Skip to main content
SumitKumar
Inspiring
November 25, 2021
Answered

How to remove non-printing character or ignore it while GREP search

  • November 25, 2021
  • 2 replies
  • 1348 views

Hi All,

 

Can you any one let me know how to find and remove non-printing character, those are converted from xml tag text to text object?

Currently I am using below code but unable to remove.

app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "~I";
footenote.texts[0].changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;

Regards,

 

 

This topic has been closed for replies.
Correct answer Laubender

Hi Sumit,

"~I" will only find index markers.

 

What you are looking for are FEFF special characters in general.

They can be found with:

app.findTextPreferences.findWhat = "<FEFF>";

They cannot be found with GREP.

 

If one instance is found you have to decide if you want to remove it.

This is quiet difficult, because FEFF is not only used for index markers or your converted tags, but also for hyperlink anchor markers and Note objects etc.pp.

 

See:

 

Delete unicode character 0xFEFF
laurent tourniel7664515, Nov 24, 2021
https://community.adobe.com/t5/indesign-discussions/delete-unicode-character-0xfeff/td-p/12547311

Especially my answer here:
https://community.adobe.com/t5/indesign-discussions/delete-unicode-character-0xfeff/m-p/12547528#M455014

 

Regards,
Uwe Laubender

( ACP )

2 replies

willcampbell7
Legend
December 3, 2021

This script does it, and more. Free download. Enable "remove zero-width characters".

https://www.marspremedia.com/software/indesign/text-cleanup

William Campbell
LaubenderCommunity ExpertCorrect answer
Community Expert
November 25, 2021

Hi Sumit,

"~I" will only find index markers.

 

What you are looking for are FEFF special characters in general.

They can be found with:

app.findTextPreferences.findWhat = "<FEFF>";

They cannot be found with GREP.

 

If one instance is found you have to decide if you want to remove it.

This is quiet difficult, because FEFF is not only used for index markers or your converted tags, but also for hyperlink anchor markers and Note objects etc.pp.

 

See:

 

Delete unicode character 0xFEFF
laurent tourniel7664515, Nov 24, 2021
https://community.adobe.com/t5/indesign-discussions/delete-unicode-character-0xfeff/td-p/12547311

Especially my answer here:
https://community.adobe.com/t5/indesign-discussions/delete-unicode-character-0xfeff/m-p/12547528#M455014

 

Regards,
Uwe Laubender

( ACP )

SumitKumar
Inspiring
November 25, 2021

Hi Laubender,

 

Thank you so much!!! This is as per my expectation.

 

 

Regards,

-Sumit