Skip to main content
Participant
December 10, 2012
Question

Access and change size of a rectangle in a shape layer

  • December 10, 2012
  • 1 reply
  • 2687 views

Hi

I'd like to use a script to access the size of a rectangle in an already existing shape layer in a composition...

I've created a myBox1 variable and assigned my shape layer to it, but I still can't find the way to access the size, I've tried myBox1.contents("rectangle 1"].property["Size"][0] but it didn't seem to work... Any idea?

Thanks

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
December 10, 2012

Try it this way:

myBox1.property("Contents").property("Rectangle 1").property("Contents").property("Rectangle Path 1").property("Size")

If you don't already have it, you'll want to pick up Jeff Almasol's wonderful rg_GimmePropPath.jsx script from his redefinery web site. It's an excellent tool for getting the scripting or expression syntax for a property's path

Dan

MuftixAuthor
Participant
December 11, 2012

Perfect, I'll have a look, but that sound like exactly what I'm looking for. Thanks!