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

What is Framer? Join the Community
Return to index
David Louie
Posted Sep 10 - Read on Facebook

Am I mistaken or could you use dot snytax to refer to nested layers in a sketch file before? So sketch.layerA.buttonlayer worked as well sketch.buttonlayer? I have icons with the same name nested in Groups that I want to refer to specifically.

5 Comments

Dennis Kerzig

This was possible before. "They can also be selected directly. There's no need for you to take the layer hierarchy into account." http://framerjs.com/learn/import/

Koen Bok

Actually, this has always been a flat list. If you want to select a sublayer you can do sketch.layerA.subLayerWithName("buttonlayer")

[please ignore]

Rory Smyth

That doesn't work for me Koen. I've always needed to do something like this sketch.layerA.subLayersByName("dropdown")[0], or [1],[2] whatever your fancy

Koen Bok

Argh yes sorry my mistake. You are right.

Marko Kršul

I lost more then few hours on that, as i am framer noob and "non-coding" designer who wants to do fast prototypes :).
In sketch, i have folder structure like this (which is logical in my view):
Challenge1: Title; Opponents (opponent1, opponent2); description;
Challenge2: Title; Opponents (opponent1, opponent2); description;
Challenge3: Title; Opponents (opponent1, opponent2); description;
...
So, if i want to access and animate opponent1 and opponent2, first i have to do some prints (like old matrix printer), write down ID-s and then set them as easy to access variables:
opponent1_1 = sketch.Challenge1.subLayers[2].subLayers[13]
opponent1_2 = sketch.Challenge1.subLayers[7].subLayers[23]
etc...

Its not quite elegant and it bothers me because in that tree view its all nicely displayed.

Or i can edit my sketch file and flatten that structure and put unique names there, which is also a pain :). (sometimes i'm not the author of those sketch files and then i have to use the same amount of time to restructure a giant list of those ChallengeX).

It would help if i could at least skip those prints at start and get layer ID by hovering with my mouse over the layer in tree view (like i'm getting coordinates now).

Read the entire post on Facebook