Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Accessing second rectangle in layer with extendscript

$
0
0

Super noob question: I'm trying to create one shape layer with two rectangles, but can't figure out how to access/add properties (change size, fill, stroke, etc) to the second rectangle.

 

var curComp = app.project.activeItem; 
var curCompHeight = curComp.height;
var curCompWidth = curComp.width; 
var rulerLayer = curComp.layers.addShape();  
var contents = rulerLayer.property("ADBE Root Vectors Group");
contents.addProperty("ADBE Vector Shape - Rect");
contents.addProperty("ADBE Vector Shape - Rect");
contents.property("ADBE Vector Shape - Rect")("ADBE Vector Rect Size").setValue([2,curCompHeight]);
contents(2).property("ADBE Vector Shape - Rect")("ADBE Vector Rect Size").setValue([2,curCompHeight]);

 

Line 10 throws an error of "null is not an object". Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>