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

Character Values of Special Characters

Engaged ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

I sometimes need to enter some of these from my plugin code. Do you have a list of the character values for each of these ?

Using a hex editor on an INDD file, I've been able to determine that indent here is #7, right-align tab is #8, normal tab is #9, soft return is #10, hard return is #13, etc...

 

But I am missing many, and in particular the "next column" and "next frame" appear as the same as a hard return in the hex editor.

 

Very best regards,

Olivier

TOPICS
Scripting , SDK

Views

499

Translate

Translate

Report

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

Community Expert , Nov 30, 2020 Nov 30, 2020

Hi Olivier,

You have found it correctly that many special characters are mapped to the same Unicode, see the following chart.

https://www.indiscripts.com/post/2009/07/idcs4-special-characters

Why don't you use the special character enum in your code rather than using its Unicode value? See the following

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#SpecialCharacters.html

-Manan

 

Votes

Translate

Translate
Community Expert ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

Hi Olivier,

You have found it correctly that many special characters are mapped to the same Unicode, see the following chart.

https://www.indiscripts.com/post/2009/07/idcs4-special-characters

Why don't you use the special character enum in your code rather than using its Unicode value? See the following

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#SpecialCharacters.html

-Manan

 

Votes

Translate

Translate

Report

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
Engaged ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

Hi Manan,

Thank you very much for the 2 links.

Do I understand correctly from the 1st link that if I want to enter text into a box linked to another, I can use ^R to insert a frame break such as "text in box1^Rtext in box 2" and this will cause "text in box 2" to be in the linked box ?

I would, of course, prefer to use enums, as in your second link, but thoese enums seem to be only for scripting; I could not find them anywhere in the SDK. Did I not look properly ?

Very best regards,

Olivier

Votes

Translate

Translate

Report

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 ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

I have not tried it but it seems the file MetaChar.h should be of interest. It's present at the following location in the SDK

{SDK_Basepath}/source/public/includes/MetaChar.h

-Manan

Votes

Translate

Translate

Report

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
Engaged ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

Hi Manan,

Thnak you very much.

It does sound interesting, but I am not sure where to use it.

Is there a sample project that uses these metachars ?

Very best regards,

Olivier

Votes

Translate

Translate

Report

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
Engaged ,
Nov 30, 2020 Nov 30, 2020

Copy link to clipboard

Copied

Hi Manan,

I am still not able to insert a Frame Break.

When I insert text using 

textModel->Insert(position, &data, language);

then I am able to replace many special characters such as kTextChar_IndentToHere and kTextChar_RightAlignedTab, but for kTextChar_FrameBoxBreak, there is a comment in the SDK code that "These are used only by Find/Change, and are not stored in a document", and the result is that the string "<E00D>" appears instead of a framebreak, as shown below.

What am I doing wrong ?

Very best regards,

Olivier

 

2020-12-01_06-30-57.png

Votes

Translate

Translate

Report

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
Guide ,
Dec 02, 2020 Dec 02, 2020

Copy link to clipboard

Copied

Do not directly invoke model modifying methods, at the lowest level use commands instead. See the programming guide for details.

 

At a higher level, some text related commands are available thru ITextModelCmds.

For your special case I can only refer to ITextEditSuite, eventually I've just missed any Utils/Facade with a less than obvious name.

 

Anyway, instead of going thru a suite, you want to end up executing kInsertBreakCharacterCmdBoss.

UIDList refers to the story, IRangeData sets the offset, and for IIntData use 3.

 

Under the hood (no need to do it yourself) this invokes two sub-commands: kUserTypeTextCmdBoss to insert the actual character 0x000d, followed by a kUserApplyAttrCmdBoss which applies kTextAttrGotoNextXBoss with IID_ITEXTATTRBREAKBEFOREMODE set to the 3 of above - the numeric value for enum Text::StartBreakLocation … kAtFrameBox.

Votes

Translate

Translate

Report

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
Engaged ,
Dec 02, 2020 Dec 02, 2020

Copy link to clipboard

Copied

LATEST

Hi Dirk,

Thank you very much for your suggestion.

We will try it and let you know how it goes.

Very best regards,

Olivier

Votes

Translate

Translate

Report

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