Skip to main content
May 12, 2014
Answered

Shape Layers: Undefined is not an object

  • May 12, 2014
  • 1 reply
  • 1823 views

I’ve used rd_GimmePropPath to get the Match Names for shape properties but I get an “undefined is not an object” error using the following:

app.project.item(1).layer("Shape").("ADBE Root Vectors Group")("ADBE Vector Shape - Ellipse")("ADBE Vector Ellipse Position”).setValue(-535,-311);

Any insight into accessing shape layer properties via scripting would be appreciated.

This topic has been closed for replies.
Correct answer Dan Ebberts

Thanks for your persistence. I'm not having any luck, copied and pasted the code you sent and it just stops dead with an error. Tested on 2 machines.

I owe you one Dan. You're a tremendous asset to the community, I used the tip jar on your site to help you keep the lights on.

Pinky is a reference to  Pinky and the Brain (TV Series 1995–1998) - IMDb


Are you still getting the "undefined is not an object" error?

I would break it into pieces and see where you're getting the error:

var myLayer = app.project.item(1).layer("Pinky");

var temp1 = myLayer.property("ADBE Root Vectors Group");

var temp2 = temp1.property("ADBE Vector Group");

var temp3 = temp2.property("ADBE Vectors Group");

var temp4 = temp3.property("ADBE Vector Shape - Ellipse");

var temp5 = temp4.property("ADBE Vector Ellipse Position");

temp5.setValue([-535,-311]);

Dan

1 reply

Dan Ebberts
Community Expert
Community Expert
May 12, 2014

It probably needs to be like this:

setValue([-535,-311]);


Dan

May 12, 2014

Thank you for the reply Dan, but no joy using the following:

           app.project.item(1).layer("Pinky").("ADBE Root Vectors Group")("ADBE Vector Shape - Ellipse")("ADBE Vector Ellipse Position").setValue([-535,-311]);

I too had thought it might need to be passed an array, the issue seems to be accessing the object itself.

Dan Ebberts
Community Expert
Community Expert
May 12, 2014

Sorry, that's what I get for guessing.

It appears to work if you don't use the compact notation, like this:

app.project.item(1).layer("Pinky").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Shape - Ellipse").property("ADBE Vector Ellipse Position").setValue([-535,-311]);

Dan