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

[JS] MIDDLE DOT

Enthusiast ,
Jul 03, 2015 Jul 03, 2015
Hello,

I do a test on the first character but I can not put the right code to "MIDDLE DOT" the \ u00B7 not funzione code.


                         if ( mesPara.characters[0].contents == 1396862068 || mesPara.characters[0].contents == '\u00B7' && leStyleOK == false) {// if Niv 02.2

                              // routine

                               mesPara.characters[0].contents = '\u25CF';

                         }



Someone an idea thank you

TOPICS
Scripting
488
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 ,
Jul 04, 2015 Jul 04, 2015

Hi Philippe,

I tried something like this with a minimal code like this and it worked:

var myUnicodeString = "\u00B7";

var myNewUnicodeString = "\u25CF";

//Text frame selected:

var myText = app.selection[0];

var myParagraphs = myText.paragraphs.everyItem().getElements();

for(var n=0;n<myParagraphs.length;n++){

    if(myParagraphs.characters[0].contents === myUnicodeString){

        myParagraphs.characters[0].contents = myNewUnicodeString;

        };

   

    };

Before running the snippet (the left text frame), after running the snippet (the right text frame):

Before-After-RunningSnippetCode.png

Font: Mistral Regular

Tested with InDesign CS5.5 on Mac OSX 10.6.8.

Maybe we need the whole picture code wise with some explanations on how your document is built and how your paragraph style and character style is built? Used fonts?

Uwe

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
Enthusiast ,
Jul 10, 2015 Jul 10, 2015
LATEST

Thank you for your reply, I come back to this issue soon I test result

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