Skip to main content
Known Participant
February 13, 2026
Question

Why doesn't path item contain all info?

  • February 13, 2026
  • 2 replies
  • 0 views

My setup

 

  • photoshopVersion: 26.9.0
  • scriptingVersion: 26.9
  • ExtendScript


I have some shape layers that were created with the pen tool (I think).

 

Now, I was trying to inspect the points in the subpath items of the path item associated with this shape layer. 

 

To access the path item associated with this shape layer, I can (apparently) do it 2 ways, but in both ways I get the problem I’ll describe below.

 

The first way is just to select “pathItem = myActiveDoc.pathItems[0]”, which you could argue is not reliable as there can be multiple paths, but bear with me and assume I don’t have any other path and have only these shape layers. The second way is to create a temporary path item from the shape layer’s vector mask using the action manager.

 

Anyway, after that, I iterate the “subPathItems” of “pathItem”, i.e. “subPathItem0 = pathItem.subPathItems[0]” and “subPathItem1 = pathItem.subPathItems[1]”. In my case, there are only 2 subpath items. 

 

Now, it seems that “subPathItem0” has only 1 point, i.e. “subPathItem0.pathPoints.length === 1”, while subPathItem1 has 29 points, which means that this first subpath is degenerate, as far as I understand. 

 

However, in photoshop, I see 2 big apparently isolated shapes in the same shape layer, so I expect to get at least 2 subpath items, which are not degenerate.

 

From what I can see, this issue often or always occurs when we have a shape layer where we have visually isolated shapes (islands). However, in some cases, some visual island are included in one subpath item’s points.

 

Has anyone ever experienced this? Is there a way to get all these shapes as vector paths?

 

If I export these shape layers as SVGs (i.e. right-click on the shape layer and then “Copy SVG”), I do see the correct shapes. So, this feature is working correctly, but apparently the subpath items don’t contain all info.

 

I actually don’t know if the different shapes I see in the shape layer should be different path items or different subpath items on the same path item. But in Photoshop, if I select the shape layer I’m interested in, in the Panels tab, I see only one path. If I delete that path, all the shapes are deleted. So, I’d assume that the shapes should be encoded into the subpath items for 1 path item, not in multiple path item.

 

Maybe I’m missing some precondition or something or need to collect the rest of the data from somewhere else. I really have no idea. I couldn’t find any other info so far.

    2 replies

    c.pfaffenbichler
    Community Expert
    Community Expert
    February 14, 2026

    The first way is just to select “pathItem = myActiveDoc.pathItems[0]”, which you could argue is not reliable as there can be multiple paths, but bear with me and assume I don’t have any other path and have only these shape layers. The second way is to create a temporary path item from the shape layer’s vector mask using the action manager.

    AM code should be able assess the Vector Mask itself, creating a temporary path seems unnecessary. 

    c.pfaffenbichler
    Community Expert
    Community Expert
    February 14, 2026

    Please provide a file with the path. (A white jpg with the Path would suffice.) 

     

    A one-point-path seems perfectly possible.