Access: 'what anchor the component attaches' via code

Is there a way to read and set the status of the anchor symbol (in the grey info box) via script?
I am aware of how to access anchors and components, but neither seem to have the information saved in the basic data.

Kind of trying to solve this among other functionality in a script.

For most components there is only one option so it doesn’t need to be set specifically. If you see the anchor symbol in the component info box, there is a choice and that can be set/read with the anchor property. It is not wrapped, yet (but documented in the “Core” docs).

anchorName = component.anchor()

Thanks Georg, this looks more than logically. Works.

Now I happen to realise, that this little anchor symbol doesn’t show itself when I select a component that showed it just some minutes before. Also wenn I use the script, it prints top_lower as anchor (which I previously set up via the now vanished anchor symbol.

A restart of GlyphsApp Version 2.1.1 (769) solved it. The Anchor Symbol is back where expected.

can you try the latest cutting edge version. I remember that I worked on it recently.

I do now. Just experienced the anchor symbol disappearing again. After a restart of GlyphsApp it was there again. Cause could have been the deleting of an custom anchor that has been used by other components.

Reproduce procedure:
– in /h have anchors: top, top_left, top_higher
– in /hcaron attach the caron to top_higher
– in /uniE516 put components /h and /acute, attach the acute to top_left anchor
– back in /h delete the top_left anchor
now in all glyphs where there should be an option for which anchor each component shall be attached to it will be gone until restart of glyphs (or apparently at least the file)

It is a bit messy to reproduce, but at least this is a real case scenario I could do atm. Version 2.1.1 (782)

The button in still there but it lost the image, so you can see it but still klick it.

interesting (: