Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sketch = context.api(),
- document = sketch.selectedDocument,
- selection = context.selection
- function randomIntFromInterval(min,max) {
- return Math.floor(Math.random()*(max-min+1)+min)
- }
- for(var i = 0; i < selection.length; i++) {
- var layer = selection[i].frame()
- // RANDOMIZE X POSITION
- // var currX = layer.x()
- // layer.setX(currX + randomIntFromInterval(0, 5))
- // RANDOMIZE Y POSITION
- // var currY = layer.y()
- // layer.setY(currY + randomIntFromInterval(-10, 10))
- // RANDOMIZE HEIGHT
- // var currHeight = layer.height()
- // layer.setHeight(currHeight - randomIntFromInterval(0, 30))
- // RANDOMIZE WIDTH
- // var currWidth = layer.width()
- // layer.setWidth(currWidth - randomIntFromInterval(-20, 20))
- }
Add Comment
Please, Sign In to add comment