Skip to main content
Known Participant
August 5, 2015
Question

Script for closing the open paths on Illustrator CC2015

  • August 5, 2015
  • 2 replies
  • 7029 views

Can someone give me a script to close all the open paths on Illustrator CC2015 ?  Thanks.

2 replies

rcraighead
Legend
July 13, 2022

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();

 

Ten A
Community Expert
Community Expert
August 5, 2015

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

meritproAuthor
Known Participant
August 5, 2015

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

Inspiring
August 5, 2015

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 ?