Hi everyone,
I’m scripting in Glyphs 3 (GlyphsApp Python) and I’m stuck on working with Extra Nodes (the virtual intersection nodes shown via View → Show Nodes → Extra Nodes).
Goal
- User clicks/selects an Extra Node (intersection) in Edit view.
- My script should apply a corner component (e.g. _corner.inktrap) to that exact intersection.
- Ideally it should apply to every master (similar to what the UI “corner component” action does on the curent layer only).
What I’m unsure about
- How to retrieve the selected Extra Node reliably
- layer.selection gives me objects, but I’m not sure what the selected extra node is supposed to be in the API (sometimes it seems like GSNode, sometimes GSHandle).
- I can get a position, but I don’t know the “official” way to identify the selected intersection.
- How to attach a corner hint to an intersection (not prev/next real node)
- I understand corner components are stored as GSHint with type = CORNER and name = “_corner.*”.
- For extra nodes, it seems the hint must be attached to a handle returned by layer.intersections() (a GSHandle), not a regular path node.
- If I attach the hint to a nearby real node, the corner “jumps” to the previous/next node instead of the intersection.
- How to apply the same “selected intersection” on every master
- If I match the selected intersection by position and then search in each master layer’s layer.intersections(), is that the correct approach?
- Are intersection indices stable across masters, or should this always be position-based with a tolerance?
Minimal sketch of what I’m trying
from GlyphsApp import Glyphs, GSHint, CORNER
layer = Glyphs.font.selectedLayers[0]
sel = list(layer.selection)
inters = list(layer.intersections()) # list of intersection handles
# find the intersection handle that corresponds to the selected extra node...
# (currently I only have position-based matching)
hint = GSHint()
hint.type = CORNER
hint.name = "_corner.inktrap"
hint.originNode = inters[idx] # GSHandle from intersections()
layer.hints.append(hint)
# then repeat for glyph.layers[master.id] for all masters...
Questions
- What’s the recommended way to detect which intersection the user selected (extra node)?
- Is matching selection position → layer.intersections() the intended solution? Any recommended tolerance / pitfalls?
- Does anyone have an example snippet (or can point to an existing script) that applies a _corner.* to selected extra nodes, ideally across all masters?
Thanks a lot for any pointers!


