File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -20,21 +20,20 @@ if ([selection count] > 0) {
2020
2121 var data = JSON.parse(validJSONString);
2222
23- log(data.length)
24-
2523 if (data.length > 0) {
26- for (var i=0; i <= [selection length ]; i++) {
24+ for (var i=0; i <= [selection count ]; i++) {
2725 var randomIndex = Math.floor(Math.random()*(data.length-1))
2826 var imageURLString = data[randomIndex].image;
2927 var url = [[NSURL alloc] initWithString: imageURLString];
3028
3129 var newImage = [[NSImage alloc] initByReferencingURL:url];
32-
30+
3331 var layer = [selection objectAtIndex:i];
3432
35- layer.setName(data[randomIndex].name)
33+ var fill = layer.style().fills().firstObject();
34+ fill.setFillType(4);
3635
37- layer.style().fills().firstObject().setPatternFillType(1);
36+ layer.setName(data[randomIndex].name)
3837
3938 var coll = layer.style().fills().firstObject().documentData().images();
4039
You can’t perform that action at this time.
0 commit comments