Skip to main content
Participant
March 6, 2026
Question

After Effects : difference of result in an external jsx file

  • March 6, 2026
  • 0 replies
  • 18 views

Hello

 

I would like to retreive the points of a path in a shape layer

 

In a composition, I have this layer :

“Arrow”

|_Content

  |_”CArrow”

    |_”CPath”

      |_Path

 

I create a text layer. In the source text of this layer, I write :

-- Code --

thisComp.layer("Arrow").content("CArrow").content("CPath").path.points();

-- End code --

and it works fine

 

But if I write this code in a .jsx file 

-- Code --
  var mainWindow = new Window("palette", "Get-Set arrow", undefined);
  group01 = mainWindow.add("group", undefined, "Group 01");
  group01.orientation = "row";
  var bGet = group01.add("button", undefined, "Get");

  var comp = app.project.activeItem;

  WriteLn(“name : “+comp.layer("Arrow").content("CArrow").content("CPath").path.name);

  pointsArray = comp.layer("Arrow").content("CArrow").content("CPath").path.points();

-- End code -- 

that I launch by File->scripts->Execute file script (not sure of the name, I’m using a non english version of After Effects), it doesn’t work anymore. The writeLn(...name); works fine, I see the correct name of the path. But I got an “function is undefined” for the “points()” function.

 

Why ?

The code is the same, I can get the path name (so the path exists !), but the function is undefined ?

 

Could someone help me ?

My code


    comp=app.project.activeItem;
    shape=comp.layer("Arrow");

//I try these two possibilities
    sPath=shape.content("CArrow").content("CPath");
    sPath=shape.content("CArrow").content("CPath").path;

//I also try these two possibilities
    sPoints=sPath.points(); //I got an error

    sPoints=sPath.points; //I got “undefined”