<commit_before>illustrator-scripts
======================
JavaScript scripts for Adobe Illustrator CSx.  
test environment: Adobe Illustrator CC (Windows)

**Note: How to download**

1. To download whole contents, use "Download ZIP" button on the right side of this page.

2. To download a script, click the script name in the above list. The page of the code will open. Right click on the "Raw" button, and use "Save As...".

Right clicking on the script name (link) and using "Save as" will download a source code of the webpage, not a script file.

batchTextEdit.jsx
======================
for editing the contents of the text frames all together.

**Usage:**

1. Select the text object(s) and run this script.  (Other kind of objects in the selection are ignored.)  
2. Edit the contents in the dialog. Then hit OK button.  
![desc_batchTextEdit](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_batchTextEdit.png)

**Notice:**

  - The attribute of the first character is applied to whole contents of textframe if you run this script for it.  It is assumed that each contents is plain text.

  - For the multiline contents, the return code characters are replaced to the alternative ones (default:"@/") in the dialog.  When applying the edited contents, they are replaced to the return code. This means you can't use "@/" itself in the contents.  You can change it in the setting part of the script.

  - The order of the texts in the dialog depends on the rectangle area surrounding each top-left corner of the selected textframes.  If the width of the area is greater than the height of it, the order is from left to right. Otherwise from top to bottom.

breakDashes.jsx
======================
breaks each dashed line in the selection into its components.  
You can also use "Object > Path > Outline" to break them.  
Though it results outlined (filled) paths.

**Notice:**

Illustrator's native dashes adjustment feature is ignored because it is totally out of control from JavaScript.

![desc_breakDashes](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_breakdashes.png)

dupAlongThePath.jsx
======================
duplicates the foreground selected object on the rest of selected paths with specified interval.
Optionally you can apply random scaling to each of the duplicated object.  
![desc_dupalongthepath](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_dupalongthepath.png)

**Notice:**

Smaller interval value causes longer calculation time.

grass.jsx
======================
for growing grasses on the selected paths.
See the description image for the optional values.  
![desc_grass](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_grass.png)

**Notice:**

Smaller width value causes longer calculation time.

handleGlue.jsx
======================
![desc_handleglue1](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_handleglue1a.png)  

Function : Moves the selected end points of the foreground open
path to the nearest point on the other selected paths. This process
includes adjustments of tangency of the handles.  

How To Use : Select paths (anchor points to move and the segments
to move them to) and run this script.  

You can set optional values by editing the script.  (No UI for now.  This is a script written for creative cloud extension.)  

![desc_handleglue2](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_handleglue2a.png)  

mode "nearest" : moves the selected end points of the foreground
open path(s) to its anchor point's nearest point on the other
selected segments.  The handle is rotated to the tangent's angle
at the point.  

mode "angle" : moves the selected end point of the foreground
open path(s) to its inner handle's nearest tangent point on
the other selected paths.  If the segment is straight, (and
if the handle of selected point is parallel to it), selected
end point is moved to its nearest point on it.  

"multi" : If true, it moves all the open path in the selection.
Otherwise, it moves only the foreground open path.  If true and
all the selected paths are open path, the last (most background)
path is treated as "the other path".  

"add anchor" : If true, it adds an anchor point at the point
on the path that the selected anchor moved to.  


inscribedCircle.jsx
======================
This script tries drawing an inscribed circle for each selected path.  
Usage: select paths and run this script.  
![desc_inscribedCircle](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_inscribedCircle.png)

**Notice:**

This one simply uses an intersection point of two bisectors of angles to determine the center of the circle. 
It's not always an inscribed circle for the shape.

newLayer(&L).jsx
======================
This script adds a new layer that has custom selection mark color above the active layer.  
![desc_newLayer](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_newlayer.png)

(&L) in the filename is for the Alt key shortcut in Windows.  
You can run the script by Alt-F->R->L.

noiseFill.jsx
======================
changes the colors of the selected paths using Perlin noise.  
![desc_noiseFill](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_noisefill.png)

Usage: Select filled paths and run this script.  
(The objects other than filled paths in the selection are ignored.)

**Notice:**

This script requires "perlin-noise-simplex.js" by <NAME>.  <commit_msg>fixed readme.md<commit_after>illustrator-scripts
======================
JavaScript scripts for Adobe Illustrator CSx.  
test environment: Adobe Illustrator CC (Windows)

**Note: How to download**

1. To download whole contents, use "Download ZIP" button on the right side of this page.

2. To download a script, click the script name in the above list. The page of the code will open. Right click on the "Raw" button, and use "Save As...".

Right clicking on the script name (link) and using "Save as" will download a source code of the webpage, not a script file.

batchTextEdit.jsx
======================
for editing the contents of the text frames all together.

**Usage:**

1. Select the text object(s) and run this script.  (Other kind of objects in the selection are ignored.)  
2. Edit the contents in the dialog. Then hit OK button.  
![desc_batchTextEdit](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_batchTextEdit.png)

**Notice:**

  - The attribute of the first character is applied to whole contents of textframe if you run this script for it.  It is assumed that each contents is plain text.

  - For the multiline contents, the return code characters are replaced to the alternative ones (default:"@/") in the dialog.  When applying the edited contents, they are replaced to the return code. This means you can't use "@/" itself in the contents.  You can change it in the setting part of the script.

  - The order of the texts in the dialog depends on the rectangle area surrounding each top-left corner of the selected textframes.  If the width of the area is greater than the height of it, the order is from left to right. Otherwise from top to bottom.

breakDashes.jsx
======================
breaks each dashed line in the selection into its components.  
You can also use "Object > Path > Outline" to break them.  
Though it results outlined (filled) paths.

**Notice:**

Illustrator's native dashes adjustment feature is ignored because it is totally out of control from JavaScript.

![desc_breakDashes](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_breakdashes.png)

dupAlongThePath.jsx
======================
duplicates the foreground selected object on the rest of selected paths with specified interval.
Optionally you can apply random scaling to each of the duplicated object.  
![desc_dupalongthepath](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_dupalongthepath.png)

**Notice:**

Smaller interval value causes longer calculation time.

grass.jsx
======================
for growing grasses on the selected paths.
See the description image for the optional values.  
![desc_grass](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_grass.png)

**Notice:**

Smaller width value causes longer calculation time.

handleGlue.jsx
======================
![desc_handleglue1](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_handleglue1a.png)  

Function : Moves the selected end points of the foreground open
path to the nearest point on the other selected paths. This process
includes adjustments of tangency of the handles.  

How To Use : Select paths (anchor points to move and the segments
to move them to) and run this script.  

You can set optional values by editing the script.  (No UI for now.  This is a script written for creative cloud extension.)  

![desc_handleglue2](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_handleglue2a.png)  

mode "nearest" : moves the selected end points of the foreground
open path(s) to its anchor point's nearest point on the other
selected segments.  The handle is rotated to the tangent's angle
at the point.  

mode "angle" : moves the selected end point of the foreground
open path(s) to its inner handle's nearest tangent point on
the other selected paths.  If the segment is straight, (and
if the handle of selected point is parallel to it), selected
end point is moved to its nearest point on it.  

"multi" : If true, it moves all the open path in the selection.
Otherwise, it moves only the foreground open path.  If true and
all the selected paths are open path, the last (most background)
path is treated as "the other path".  

"add anchor" : If true, it adds an anchor point at the point
on the path that the selected anchor moved to.  


inscribedCircle.jsx
======================
This script tries drawing an inscribed circle for each selected path.  
Usage: select paths and run this script.  
![desc_inscribedCircle](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_inscribedCircle.png)

**Notice:**

This one simply uses an intersection point of two bisectors of angles to determine the center of the circle. 
It's not always an inscribed circle for the shape.

newLayer(&L).jsx
======================
This script adds a new layer that has custom selection mark color above the active layer.  
![desc_newLayer](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_newlayer.png)

(&L) in the filename is for the Alt key shortcut in Windows.  
You can run the script by Alt-F->R->L.

noiseFill.jsx
======================
changes the colors of the selected paths using Perlin noise.  
![desc_noiseFill](https://github.com/shspage/illustrator-scripts/raw/master/image/desc_noisefill1.png)

Usage: Select filled paths and run this script.  
(The objects other than filled paths in the selection are ignored.)

**Notice:**

This script requires "perlin-noise-simplex.js" by <NAME>.  
{'fraction_non_alphanumeric': 0.10357304387155133, 'fraction_numerical': 0.0015377657168701945, 'mean_word_length': 4.465150766188828, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2386238', 'n_tokens_mistral': 3052, 'n_tokens_neox': 2931, 'n_words': 1411}