Call "Component from selection" in script

Hi everybody!

I’m writing a script to create a new component from a selected path and set ‘custom’ and ‘_custom’ anchors in position for auto-alignment.
It would speed my process up a notch if I knew how to call the function “Components from selection” in the script. Any suggestion?

That is a mouthful:

newGlyphName = "newName"
Font.parent.windowController().toolInstances()[0].eventHandler().doComponentFromSelection_glyphName_addGlyph_(Layer, newGlyphName, True)
2 Likes

Works a charm, thanks Georg! <3