Skip to main content
schroef
Inspiring
July 14, 2023
Question

Get sub items from pluginItem [pathfinder object]

  • July 14, 2023
  • 2 replies
  • 525 views

I'm looking for script or code to loop through a pluginItem. The item is being generated when you use 2 paths or compound shapes and then use subtract while holding alt in the Pathfinder options. Second icon on the top left in the panel. This items is sort of a live boolean, we can still move the paths.

If I try to use selection.length to t returns 1. I can't seem to fine code how to access the children items or sub items

 

This topic has been closed for replies.

2 replies

Legend
July 14, 2023

It may help to know that compound shape can be released with an action, and that it can be retrieved with a selection when only its contents are selected.

m1b
Community Expert
Community Expert
July 14, 2023

Nice! I always forget about actions. 

m1b
Community Expert
Community Expert
July 14, 2023

Hi @schroef, unfortunately I think the answer is that Illustrator's scripting API does not give us access to path items of a pathfinder PluginItem. I wondered if there was an "executeMenuCommand" to release the pathfinder but I couldn't find that either. I hope someone else has better news for you.

- Mark

schroef
schroefAuthor
Inspiring
July 14, 2023

I've been looks jg at some threads but also have not find anything usefull. The issue is that a pluginItem can be different things. So I'm not sure how I can get access to some props telling ng more about the pluginItem object. The scripts ng reference doesn't show much about a pluginItem. 

 

Perhaps I should try to group and then expand it. Then check if the items are either pathItem or compundPathItem. Then I can continue with the script to check for its area.

 

Though this will destroy the original object. So I guess I need to duplicate it first and then run the script on that duplicate.

 

Other issue will be that a live traced object, I believe, will also return type ame as pluginItem. So that object will/can cause se issues.

 

My script needs to get the area of a shape. That's what I'm looking for. Perhaps I just need to test .area on that pluginItem. Now thinking about it, I haven't actually tried thay yet