Need a simple macro/script

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?


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() = "Copy"
Layer.shapes = []
Layer.anchors = []
glyph = Layer.parent
1 Like

Nice! worked great, thanks!
Is there any way to make the copy visible? didnt found anyhing like visible.

You can use layerCopy.setVisible_(True).

1 Like

I added layer.visible to the wrapper.

1 Like