Copy link to clipboard
Copied
Hi
I want to "Pathfinder Trim" the selected groups with a Script.
But
app.executeMenuCommand("Live Pathfinder Trim");
app.executeMenuCommand("expandStyle");
Found a workaround 🙂
First I merge all pathItems (triangles) of one Layer to ONE pathItem, then "selectall" > "group" > "trim" > "expand style" > "ungroup".
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I already tried with
app.executeMenuCommand("group");
app.executeMenuCommand("Live Pathfinder Trim");
app.executeMenuCommand("expandStyle");
app.executeMenuCommand("ungroup");
But since I already have groups and triming them "manually" did work,
I supposed that it also would work by script without grouping the groups.
When I do it like this, then all the groups get lost. But I need to keep the shape which is defined by the path-elements in the group.
Result doing trim manually (each group of paths after trim is a unique path or compoundpath):
Result doing trim by script (grouping groups first):
In the attachment you find the original file.
Copy link to clipboard
Copied
Why can't I upload an ai-File here?
Filetype is allowed (see below), but when I post the post then it gets removed.
Copy link to clipboard
Copied
You can't upload ai files here (I don't know why). You can upload the file to a file sharing site and post the link here.
Copy link to clipboard
Copied
Found a workaround 🙂
First I merge all pathItems (triangles) of one Layer to ONE pathItem, then "selectall" > "group" > "trim" > "expand style" > "ungroup".
Copy link to clipboard
Copied
If I'm correct the script will return pluginItem for item created with live pathfinder, right?
Do you know perhaps how to make sure the item is actually a live Pathfinder item. A pluginItem can be many things. I'm updating a script which returns area's from shapes. But it gives me errors on these live Pathfinder items
Copy link to clipboard
Copied
Do you mean pathItem instead of pluginItem (I dont know what a pluginItem is😅).
And I do not really know what a Live Pathfinder item is from a coding view.
Did you ask Chat GPT already?
Copy link to clipboard
Copied
By live pathfinder item, I meant while holding alt with 2 shapes. Certainly n vommands will do the operation but you keep both shapes intact. So in my case, I use the subtract. When I use 2 circles l, one half overlaying the other, you get this halfmoon shaped bite out of the other. But because we press alt, the one doing Ng the cutting is still a a full circle. That's why I called it it live pathfinder item.
A pluginItem, can be a couple things. When you do certain operations, the type name of that shape, changee to pluginItem. Even though in the layer panel, we can still see it name as either path or compoundpathItrm. It's a bit weird. Never knew this until this week.