Copy link to clipboard
Copied
Can someone give me a script to close all the open paths on Illustrator CC2015 ? Thanks.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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 ?
Copy link to clipboard
Copied
Please advise how to add it. I must copy and paste on NotePad ??
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
I'm very new on Ai, just try to start. So what I need to do is just copy it and paste on notepad??
Copy link to clipboard
Copied
I would recommend using the ESTK.
this stands for ExtendScript Toolkit.
as you mentioned 'notepad' I am guessing you are on a PC.
press the win key and type extend.
the Adobe ExtendScript Toolkit should be the first option.
open ESTK and paste your code in the editor.
in the pull down menu choose 'Adobe Illustrator CC 2015'
then you can use the little green Play button to run your script.
from there you can then save your script as a .jsx (this is the default)
to have the script appear in the File>Scripts menu in illustrator it need to be placed in this folder:
C:\Program Files\Adobe\Adobe Illustrator CC 2015\Presets\en_GB\Scripts
yours may vary slightly, ie \en_US\
illustrator will need to be restarted after you have saved your script in the above directory.
Copy link to clipboard
Copied
Thanks Qwertyfly, mine is pc. I got also last night a script from someone pasted on MS Word.
However, I'll try up to what you said though ESTK is new for me.
Copy link to clipboard
Copied
wongchanc59288790 wrote: I'm very new on Ai, just try to start. So what I need to do is just copy it and paste on notepad??
OK. The most basic approach (for using Scripts in Illustrator):
1.) Copy & Paste the code in a plain text ,text editor (ie: NotePad, etc. ( it must be "plain text" ))
2.) Then save the Text file from above with the extension of .js or .jsx to your desktop.
3.) Then inside Illustrator go "File Menu > Scripts > Other Script..."
This allows you to easily execute random/specific scripts that are not installed in the Scripts folder. Selecting Other Scripts displays a File Browser dialog, which you use to navigate to the script file on your desktop or wherever. When you select the file, the script will be executed.
Hope something someone suggested helps your efforts to get started with things.
Copy link to clipboard
Copied
Should Clarify that MSword is NOT a Plain Text Editor.
there are many great notepads great for scripting.
NotePad that comes with Win will work but does not have any scripting formatting.
I like "NotePad++" & " Brackets" is also quite nice.
for illustrator I use the ESTK as it links with illustrator very well and makes testing and debugging very simple.
Copy link to clipboard
Copied
thanks Qwertyfly, will download ESTK and try, may bother you again if i got a problem...
Copy link to clipboard
Copied
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();