Skip to main content
SuzzyFlamingo
Inspiring
January 7, 2026
Question

How to assign a glyph to a keyboard stroke in a best way?

  • January 7, 2026
  • 4 replies
  • 304 views

Hi, Dear Friends!

What is the best way to assign a glyph to a keyboard stroke(s).

Thank you, and have a good day!
Susan Flamingo

 

<Title renamed by moderator>

4 replies

rob day
Community Expert
Community Expert
January 7, 2026

Does @Peter Kahrel  code with '\uFB30' work? It does for me testing with the Arial Hebrew font

 

try {
    app.selection[0].contents = '\uFB30';
} catch (_) {
    alert ('Please select an insertion point');
}

 

Before:

Screen Shot.png

After

Screen Shot 1.png

Legend
January 7, 2026

Glyph IDs are font specific and only used when no other combination of character code and text attributes produces them.

E.g. when you insert the glyph via glyphs panel, InDesign will try its best to insert a real character set various attributes or toggle umpteen opentype settings for it (the mouse-over tip for that glyph will tell). Only if that fails, it produces a real glyph.

 

Back to the problem. The easiest way in UI is to use an otherwise unused character and find-change-glyphs it when you have entered all of them.

I first thought (as in: burnt an hour) entering the gid/cid using a script should also be possible along Peter's attempt, but then remembered the old script from the original InDesign team themselves that creates all glyphs for a range by using an import - was it tagged text? When I needed it, I wrote an experimental plugin that produces random glyphs for the current font (for testing that font) but that won't help here.

 

Scripted find change glyph along my UI suggestion should be a more modern way. Left as exercise for any takers.

SuzzyFlamingo
Inspiring
January 7, 2026

Wow, could not imagine it was such a big deal

 

Peter Kahrel
Community Expert
Community Expert
January 7, 2026

Place this script in your Scripts folder (change x to the character you need):

try {
  app.selection[0].contents = 'x';
} catch (_) {
  // Fail silently
}

 then in the Keyboard Shortcut editor apply a shortcut key to that script.

SuzzyFlamingo
Inspiring
January 7, 2026

it is glyph id g163

I copied and pasted into a text editor to write your script and nothing shows up... sigh...

Peter Kahrel
Community Expert
Community Expert
January 7, 2026

You need to select an insertion point. This version of the script tells you if you didn't have an insertion point selected:

try {
  app.selection[0].contents = 'x';
} catch (_) {
  alert ('Please select an insertion point');
}
Willi Adelberger
Community Expert
Community Expert
January 7, 2026

Look, if there is not a specific key dedicated to the glyph.

SuzzyFlamingo
Inspiring
January 7, 2026

nope. non-English character. Any ideas?

Willi Adelberger
Community Expert
Community Expert
January 7, 2026

Whar OS and what characters?