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) {
20
20
21
21
var data = JSON.parse(validJSONString);
22
22
23
- log(data.length)
24
-
25
23
if (data.length > 0) {
26
- for (var i=0; i <= [selection length ]; i++) {
24
+ for (var i=0; i <= [selection count ]; i++) {
27
25
var randomIndex = Math.floor(Math.random()*(data.length-1))
28
26
var imageURLString = data[randomIndex].image;
29
27
var url = [[NSURL alloc] initWithString: imageURLString];
30
28
31
29
var newImage = [[NSImage alloc] initByReferencingURL:url];
32
-
30
+
33
31
var layer = [selection objectAtIndex:i];
34
32
35
- layer.setName(data[randomIndex].name)
33
+ var fill = layer.style().fills().firstObject();
34
+ fill.setFillType(4);
36
35
37
- layer.style().fills().firstObject().setPatternFillType(1);
36
+ layer.setName(data[randomIndex].name)
38
37
39
38
var coll = layer.style().fills().firstObject().documentData().images();
40
39
You can’t perform that action at this time.
0 commit comments