Skip to main content
Known Participant
August 5, 2015
Question

Script for closing the open paths on Illustrator CC2015

  • August 5, 2015
  • 2 replies
  • 6990 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

meritproAuthor
Known Participant
August 5, 2015

The thread you referenced above goes over how to do that. So is it safe to assume you never tested nor used that script either, from the referenced thread you posted?


I'm very new on Ai, just try to start. So what I need to do is just copy it and paste on notepad??