Hello, I wrote a small script to paste a component into the background in all masters.
I used PickGlyphs, but I see that that method automatically pasted the selected glyph as a component into the current layer. Is this intentional?
def paste_component_to_background():
g = PickGlyphs(searchString=Layer.parent.name.split(".")[0])[0]
if not g:
return
if len(g) > 1:
Message(title="Too many glyphs picked", message="Choose exactly one glyph")
s = g[0]
for l in Layer.parent.layers:
b = l.background
b.clear()
c = GSComponent(s)
b.components.append(c)
paste_component_to_background()
Open any glyph
Run script, select a glyph
The script will paste the component into the background, but also open the selected glyph (replace the current glyph in edit view with the glyph selected in PickGlyphs)