Looking for a simple macro to do the following:
create a new layer (just like press the ‘+’)
make it visible
delete the top layer content
anyone can help me?
Thanks!
Looking for a simple macro to do the following:
create a new layer (just like press the ‘+’)
make it visible
delete the top layer content
anyone can help me?
Thanks!
Here is a script that creates a copy of the current layer and deletes all paths, components (shapes), and anchors from the current layer:
layerCopy = Layer.copy()
layerCopy.name = "Copy"
Layer.shapes = []
Layer.anchors = []
glyph = Layer.parent
glyph.layers.append(layerCopy)
Nice! worked great, thanks!
Is there any way to make the copy visible? didnt found anyhing like visible.
You can use layerCopy.setVisible_(True)
.
I added layer.visible
to the wrapper.