Pixeden Illustrator Scripts Save

Set of scripts to improve Icons workflow

Project README

illustrator-scripts

illustrator-scripts

Adobe Illustrator js scripts that could help to improve productivity and avoid possible human errors when working with SVG Icons.


Name Basic Layers

Loop into each Artboard and set a name on each path with color.

Sets a progressive Layer name (default layerX where x is a progressive number) depending on the fillColor or strokeColor (if it is a stroked or filled path). In case an element in the same Artboard has the same color, the same Layer name will be stored in memory.

important note: this script is intended to be used only when there is an unified style in the Artboard, that is: all paths are stroke or all paths are filled, not mixed. Use is-unified script to check if all Artboards respect this rule.

name-basic-layers.js


Name Mixed Layers

Loop into each Artboard and set a name on each path that has stroke, transparency and color.

Works similarly as name-basic-layers.js but with more features for situations where there are combined styles in each Artboard.

Sets a name for each layer that is stroked (default name: stroke), another name for each layer or group with transparency less than 100%, and the progressive names for each filled layer.

Note that the result in each Artboard will respect this rules:

  • each stroked path will be named as stroke (default)
  • each filled path or group with transparency will be named as opacity (default) *
  • each filled path without transparency will be named progressively like layer1 and so on (default) and assign the same name for the same color layer *

* filled paths inside a group with transparency won't receive any name

important note: this script may not work in some situations and is only intended to solve specific needs as described above.

name-color-layers.js


Ungroup

Due to an Illustrator bug when exporting named layers in nested groups, which in some cases do not receive its related property, this script ungroups everything but the transparency group (which are normally named before).

ungroup.js


Unify Color

Once all desired layers are named, it is sometimes useful to set all paths in one given color. As in the other scripts, this will set the strokeColor or fillColor depending on the path.

unifyColor.js


Is Unified Style

Checks if each Artboard has paths with strictly the same style (filled or stroked). The script breaks as soon as it finds a mixed Artboard and tell which one it is (it also remains selected, making it easy to fix).

is-unified.js


Rename Artboards

Loop into each Artboard and rename it with a String provided plus the Artboard number as a suffix.

rename-artborard.js


Center in Artboard

Loop into each Artboard and center its content. To guarantee the relative positions of its paths, the script group the content before centering it.

center-in-artboard.js


Export PNG

Loop into each Artboard and exports as a .png file in 1x, 2x and 3x resolution, organized in different folders. Filename will be the String provided followed by the Artboard name.

export-png.js

How to load and run the scripts in Adobe Illustrator

Once open the file with at least one Artboard

File > Scripts > Other Script…

Then select the script you want to use.

illustrator-scripts-howto

How to (video)


These scripts helps authoring Icons and apply rules needed to work in the Orion Icon Library App

Open Source Agenda is not affiliated with "Pixeden Illustrator Scripts" Project. README Source: Pixeden/illustrator-scripts
Stars
28
Open Issues
0
Last Commit
4 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating