var myDoc = app.activeDocument; app.findGlyphPreferences = app.changeGlyphPreferences = null; //This is example, so please change the fonts and glyphID app.findGlyphPreferences.appliedFont = "Minion Pro" app.findGlyphPreferences.fontStyle = "Regular" //Provide the glyph ID, not the glyph Unicode value. app.findGlyphPreferences.glyphID = 366; app.changeGlyphPreferences.appliedFont = "Minion Pro" app.changeGlyphPreferences.fontStyle = "Regular" //Provide the glyph ID, not the glyph Unicode value. app.changeGlyphPreferences.glyphID = 240; myDoc.changeGlyph(false); app.findGlyphPreferences = app.changeGlyphPreferences = null;
That does not use the Unicode value, it's the glyph index: InDesign ExtendScript API (12.0) . That is not the same thing.
The option to look for or replace with a Unicode is missing from the scripting engine (since CS3, I might add¹). Report it to Adobe.
Before someone says: "well it's not a problem because you can always use the regular text find/change or the GREP find/change to search for Unicode characters, like this (piece of code)". Wrong. With these you cannot (1) search for any glyph and replace it with a certain Unicode character, and (2) the other way around, search for a Unicode character and replace it with any glyph. The Glyph Find/Change dialog allows both.
¹ Which, if I remember correctly, was the first version in which this dialog appeared. So it's safe to guess "it was never there, and it was never missed in the 7 major versions since then."
I have used GID to find and replace glyphs.
- Sudha K