0 Replies Latest reply on Oct 31, 2016 4:52 PM by Obi-wan Kenobi

    Find an auto-numbering bullet glyph and replace by another

    Obi-wan Kenobi Level 5

      Hi all scripters,


      It's possible to find a glyph by its font and its GID and replace it by another one! As Dave Saunders showed us:


                if (app.documents.length > 0) {  
                          setupFindGlyph(458, 509);  
                function setupFindGlyph(fmGID, toGID) {  
                          // this is a simple demo function; it could do more  
                          app.findChangeGlyphOptions = null;  
                          app.findGlyphPreferences.appliedFont = "Adobe Caslon Pro";  
                          app.findGlyphPreferences.fontStyle = "Regular";  
                          app.findGlyphPreferences.glyphID = fmGID;  
                          app.changeGlyphPreferences.appliedFont = "Adobe Caslon Pro";  
                          app.changeGlyphPreferences.fontStyle = "Regular";  
                          app.changeGlyphPreferences.glyphID = toGID;  


      [ See:  Re: How to get glyph ID using JS?  ]


      GID 458:


      Capture d’écran 2016-11-01 à 00.35.03.png

      GID 509:


      Capture d’écran 2016-11-01 à 00.33.38.png


      It's possible too to find the font used by an auto-numbering bullet and show where! As Jarek showed us:


      myDoc = app.activeDocument;  
      fontToSearch = "Adobe Caslon Pro";
      app.findTextPreferences = null;  
      app.findTextPreferences.bulletsAndNumberingListType = ListType.BULLET_LIST;  
      mFound = myDoc.findText(true);  
      l = mFound.length;  
      while (l--) {  
                d = mFound[l].paragraphs.length;  
                while (d--) {  
                          currFont = mFound[l].paragraphs[d].bulletChar.bulletsFont;  
                          if (currFont.fullName == fontToSearch) {  


      [ See:  Re: Find BulletChar Font  ]


      Capture d’écran 2016-11-01 à 00.40.11.png


      My question is:


      Is it possible to find the first glyph above defined by its GID/its font in an auto-numbering "bullet" para style and replace it by the second one?


      Of course, it seems to be yes! … but if you try to create an auto-numbering "bullet" para style with one of the two glyphs above, you'll fail!


      Thanks in advance!