This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Lukas Imrich
Posted Nov 09 - Read on Facebook

Shouldnt something like this be possible?

layers = []
numberOfLayers = 5

for number in [0..numberOfLayers]
__layers["layer-#{number}"] = new Layer

I am using the latest beta build, latest production build yet still having the same issue. All the layers are named: "Untitled", my expectation was "layer-1" and so on

What am I doing wrong. It is actually possible to do something like I am trying to do there: layers["layer-#{number}"] = new Layer

3 Comments

Lukas Imrich

or something similar:

layers = []
numberOfLayers = 5

for number in [0..numberOfLayers]
__layers[number]= new Layer

I expect to have layers like: 0, 1, 2 ..
Instead I have layers named like: number, number, number ..

Why is that?

Rohan K

AFAIK you can create layers programmatically, go with the code in your comment, but to name them you must use the layer name property (along with width, height etc if reqd). In the layer name properly you can use the #{} to parse a counter and create names like layer1,layer2,layer3 etc.

Jordan Robert Dobson

Either that you have to place them in an object and then you don't get them ordered.

Read the entire post on Facebook