Skip to main content

12 replies

rcraighead
Legend
Jul 13, 2022 1:33 PM UTC

I realize this is an old thread, but it was helpful to me. I updated the script written by Ten A. The last 2 lines just needed "i" to identify the current path. Works great in AI 2022:

function closePaths() {

for (var i = 0; i < app.activeDocument.pathItems.length; i++) {

if (app.activeDocument.pathItems[i].closed == false)

app.activeDocument.pathItems[i].closed = true;

}

redraw();

}

 

closePaths();

 

Translate
Ten A
Community Expert
Community Expert
Aug 5, 2015 10:45 AM UTC

for (var i=0;i<app.activeDocument.pathItems.length;i++)

  if (app.activeDocument.pathItems.closed==false)

  app.activeDocument.pathItems.closed=true ;

I don't test it. Probably it works.

Ten

Translate
meritproAuthor
Known Participant
Aug 5, 2015 11:29 AM UTC

Thanks Ten, but I got this one from previous forum.  Could you help me with a check whether it can be applied with Ai CC2015?

Script for Selecting Open Paths in Illustrator CS6

Translate
Inspiring
Aug 5, 2015 12:38 PM UTC

The script you referenced in the other thread only "selects" it does not close. So given that, did you try "Ten A"'s script since that does what you asked: closes open paths ?

Translate