Skip to content

Instantly share code, notes, and snippets.

@awt2542
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awt2542/fdf07fd93ceb1b5ccbb7 to your computer and use it in GitHub Desktop.
Save awt2542/fdf07fd93ceb1b5ccbb7 to your computer and use it in GitHub Desktop.
Find multiple layers using regex and loop them through
# 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