How to find glyphs which contains the same paths?

I would like to find the glyphs which contains the same path of currently selected glyph(s).

So I use ‘Select Same Color’ script by mekkablue as reference. It uses colorIndex() to get glyph’s color index, and what should be used to get a glyph’s path?