Last active
August 29, 2015 14:25
-
-
Save awt2542/fdf07fd93ceb1b5ccbb7 to your computer and use it in GitHub Desktop.
Find multiple layers using regex and loop them through
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create some boxes with the same name | |
for i in [0..5] | |
b = new Layer | |
name: "box" | |
y: i*120 | |
# A function to find and loop through layer names matching your keyword | |
selectAll = (s, f) -> | |
for l in Framer.CurrentContext.getLayers() | |
f.apply(l) if l.name.match(s) | |
# Animate all the boxes!!! | |
selectAll 'button', -> | |
@animate | |
properties: | |
x: 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment