Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
4

Regexp for removing object character code? [JS CS4]

Explorer ,
Jan 13, 2011 Jan 13, 2011

I've got a routine that makes a list of headlines & sorts them, which ends up as bookmarks. When a headline contains an anchored object, the resulting text includes a glyph, a tiny dotted box with 'OBJ' in it, which looks bad in the final list of bookmarks. Using string.charAt(x) for the character returns 65532.

I suppose I could write a function that loops through the sentence's characters & discards any 65532, but that seems like overkill if there's a regexp replace string. I already run string.replace(/\s+/g, " ") to replace non-space invisible ctrl characters w/space, but that pattern doesn't affect the object character. Does this ring a bell with anyone?

Thanks.

TOPICS
Scripting
5.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jan 13, 2011 Jan 13, 2011

It's the "Anchored object marker" (InDesign name) or "Object replacement character" (Unicode name) . 65532 in hexadecimal is FFFC, so in java/javascript unicode notation it is "\uFFFC".

myString = myString.replace(/\uFFFC/,"");

You can use this to find the hexadecimal unicode value of a character:

myString.charCodeAt(myIndex).toString(16)
Translate
Guest
Jan 13, 2011 Jan 13, 2011

It's the "Anchored object marker" (InDesign name) or "Object replacement character" (Unicode name) . 65532 in hexadecimal is FFFC, so in java/javascript unicode notation it is "\uFFFC".

myString = myString.replace(/\uFFFC/,"");

You can use this to find the hexadecimal unicode value of a character:

myString.charCodeAt(myIndex).toString(16)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2011 Jan 14, 2011

Awesome, Haakenlid, thank you so much! The snippet worked like a charm.

And I really appreciate having a method for discovering the hex for unicode of any character.

Thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 15, 2011 Jan 15, 2011

... I really appreciate having a method for discovering the hex for unicode of any character.

If the character is somewhere in your text, all you have to do is select just this character and look in the Info panel.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 15, 2011 Jan 15, 2011

[Jongware] wrote:

... I really appreciate having a method for discovering the hex for unicode of any character.

If the character is somewhere in your text, all you have to do is select just this character and look in the Info panel.

That's a good tip. Turns out that "Right Indent Tab" has Unicode value 8, which outside of InDesign is supposed to be "Backspace". There are a few of those tricky special characters in InDesign.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 05, 2025 Jan 05, 2025

Help me please 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2025 Jan 05, 2025
LATEST
quote

Help me please 


By jatoh_5355

 

How? What's the problem? 

 

We are not mind readers... 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 05, 2025 Jan 05, 2025

what is my error in passwords 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2025 Jan 05, 2025

This is a user-to-user help forum. For anything to do with your Adobe licensing, subscription or account you need to contact Adobe technical support in your country or region.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines