Skip to main content
Berezin_Illustrator
Known Participant
October 4, 2020
Question

Order script

  • October 4, 2020
  • 1 reply
  • 729 views

Hi. I need a script to group same color paths to same groups and after, combine/join paths in this groups into objects.

 

What do you think?

P.S Sorry I am not good at English.

This topic has been closed for replies.

1 reply

Berezin_Illustrator
Known Participant
October 4, 2020

About "group same color paths to same groups" I mean situation like this

femkeblanco
Legend
October 5, 2020

This is a primitive way of grouping path items with the same stroke color.

var paths = app.activeDocument.pathItems;
for (var i = 0; i < paths.length; i++) {
  if (paths[i].parent != "GroupItem") {
    paths[i].selected = true;
    app.executeMenuCommand("Find Stroke Color menu item");
    app.executeMenuCommand("group");
    app.executeMenuCommand("deselectall");
  }
}

I'm afraid I don't understand the second part of your question.

Berezin_Illustrator
Known Participant
October 5, 2020

About second part.

I can't fill the surfaces because they are not surfaces. They are a lot of paths. I need to join (Like Ctrl+j) this paths into surfaces.

 

For example cube.

On my picture you can see the cube like 3 surfaces (like surface x, surface y, surface z). But this surfaces are consist from separate paths. Could I combine it by script?