Sg 2.9
Layer
Packages RSS
About
News
Gallery
Scripts
Tutorials
Download
Reference
Forum
Users
License
Twitter

Extends Item

The Layer item represents a layer in an Illustrator document.

The layer which is currently active can be accessed through document.activeLayer. An array of all layers in a document can be accessed through document.layers.

Sample code:

print(document.activeLayer.name); // 'Layer 1'
var layer = new Layer();
layer.name = 'A new layer';
layer.activate();
print(document.activeLayer.name); // 'A new layer'
print(document.layers.length); // 2

Constructors

Creates a new Layer item.

Sample code:

var layer = new Layer();
layer.name = 'the new layer';

Properties

Specifies whether the layer is visible.

    Returns:
  • Booleantrue if the layer is visible, false otherwise

Specifies whether the layer is set to preview (true) or outline mode (false). If a layer is set to outline mode, items in all it's child layers are rendered in outline mode, regardless of their preview settings.

    Returns:
  • Booleantrue if the layer is set to preview, false if the layer is set to outline

Specifies whether the layer is considered printable when printing the document.

    Returns:
  • Booleantrue if the layer is considered printable, false otherwise

Specifies the color used for outlining items when they are selected.

Returns all items contained within the layer, including indirect children of the layer.

Sample code:

var group = new Group();
var path = new Path();
group.appendTop(path);
// the direct children of the layer:
print(document.activeLayer.children); // Group (@31fbd500)
// all items contained within the layer:
print(document.activeLayer.items); // Group (@31fbd500), Path (@31fbbb00)
Read-only.

    Returns:
  • Array of Item, also accessible by name

Specifies whether the layer is active.

    Returns:
  • Booleantrue if the layer is active, false otherwise

The next item on the same level as this item. Read-only.

The previous item on the same level as this item. Read-only.

Functions

Activates the layer.

Sample code:

var layer = new Layer();
layer.name = 'new layer';
layer.activate();
print(document.activeLayer) // 'Layer (new layer)'

Inheritance

AltStyle によって変換されたページ (->オリジナル) /