# An id for GSAnchors?

**URL:** <https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573>\
**Category:** Glyphs\
**Created:** [June 17, 2026, 12:31pm UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573 "2026-06-17T12:31:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCarewe](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/scarewe/32/18952_2.png) [@SCarewe](https://forum.glyphsapp.com/u/SCarewe)\
**Post date:** [June 17, 2026, 12:31pm UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/1 "2026-06-17T12:31:55Z")

</div>

I am storing anchor references only by name, but I have no way of tracking rename events. I see that GSAnchor objects don’t have an id property. Is this something that was never implemented on purpose? Would this be feasible? Is there some other way of reliably tracking anchor renames so that references don’t break?

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [June 17, 2026, 5:44pm UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/2 "2026-06-17T17:44:37Z")

</div>

Why do you need that?

---

<div class="post-metadata">

**Author:** ![SCarewe](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/scarewe/32/18952_2.png) [@SCarewe](https://forum.glyphsapp.com/u/SCarewe)\
**Post date:** [June 17, 2026, 6:34pm UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/3 "2026-06-17T18:34:53Z")

</div>

Because I want to store a reference to an anchor in a node’s userData. However, all I can currently do is store the anchor’s name in the userData. So when I change the name of the anchor, this userData becomes useless. I would either like to update the anchor name in the userData when that anchor is renamed, or just store a unique ID that isn’t affected by the anchor being renamed.

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [June 18, 2026, 6:34am UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/4 "2026-06-18T06:34:09Z")

</div>

You can add an ID to `anchor.attributes`.

---

<div class="post-metadata">

**Author:** ![HugoJ](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/hugoj/32/30341_2.png) [@HugoJ](https://forum.glyphsapp.com/u/HugoJ)\
**Post date:** [July 26, 2026, 8:09pm UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/5 "2026-07-26T20:09:42Z")

</div>

GSAnchor.attributes is present in memory and gone from the file after a save.

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [July 26, 2026, 8:55pm UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/6 "2026-07-26T20:55:41Z")

</div>

I tried this:

```auto
Layer.anchors["top"].attributes["Foo"] = "bar"
print(Layer.anchors["top"].attributes)

```

then I see this in the file:

```auto
anchors = (
{
attr = {
Foo = bar;
};
name = top;
pos = (300,700);
}

```

Do you happen to write a glyphs 2 file?

---

<div class="post-metadata">

**Author:** ![HugoJ](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/hugoj/32/30341_2.png) [@HugoJ](https://forum.glyphsapp.com/u/HugoJ)\
**Post date:** [July 27, 2026, 5:15am UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/7 "2026-07-27T05:15:34Z")

</div>

It works in Glyphs 3 but not with Glyphs 4

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [July 27, 2026, 7:12am UTC](https://forum.glyphsapp.com/t/an-id-for-gsanchors/36573/8 "2026-07-27T07:12:27Z")

</div>

Glyphs 4 was only writing them in format 4 files. But the update from last night fixes that.
