Access uppercase glyphs

Newbie scripter here… if I run

print( Glyphs.font.glyphs["A"].name )
print( Glyphs.font.glyphs["A"].case )

Macro window returns me this:

A
1

that means .case =1, correct?

So, why this doesn’t work?

UC = [g for g in Glyphs.font.glyphs
	if g.case == "1"
	and g.export
	]

print (UC)

Returns:
[ ]

And, why Uppercase is not a subCategory by default? — if I manually set this at Glyph Info, I can use the g.subCategory == Uppercase

g.case is an int, not a string and you can use some predefined constants: Glyphs.app Python Scripting API Documentation — Glyphs.app Python Scripting API 3.0 documentation

if g.case == GSUppercase:
    #do something.
1 Like