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

What is Framer? Join the Community
Return to index
Kevin Velasco
Posted Mar 15 - Read on Facebook

Hi guys!

quick question, how can I grab every single layer from all artboards from all pages from a sketch import?

9 Comments

Kevin Velasco

I can only seem to iterate through import['artboard"].sublayers.
anything else just returns... well, returns nothing.

Kevin Velasco

you can group artboards??!?!?

Kevin Velasco

oh, wait. No you can't. I don't get what you mean just now.
Do you mean make one massive artboard that covers everything?

Cemre Güngör

import should contain every layer. its not hierarchical

Kevin Velasco

I mean, I want to add a particular property to every single layer. That's the goal. Which means I need to be able to iterate through every single layer.

here's some pseudocode:

for page in sketchfile
...for artboard in page
......for layer in artboard
.........layer.on Events.Click, ->
............#something

because
file = Framer.Importer.Load #####
for layer in file

doesn't work.

Chris Camargo

Have you read the last portion of the Import docs here? http://framerjs.com/learn/import/

Kevin Velasco

......

RTFM

Chris Camargo

"Did I RTFM?" is always a great question to ask yourself when stuck. :)

Kevin Velasco

I mean, I should have RTFM-ed. Thanks for the help!

Read the entire post on Facebook