EDOBE XDOM EM Specifications Page 131

  • Download
  • Add to my manuals
  • Print
  • Page
    / 231
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 130
Adobe Photoshop CS6
JavaScript Scripting Reference JavaScript Object Reference 131
LayerSets
The collection of LayerSet objects in the document.
Access the top-level layer sets in a document through the Document
.layerSets collection property. For
example:
var layerSetRef = app.activeDocument.layerSets.add()
Access the nested layer sets through the LayerSet.layerSets collection property in the parent set. For
example:
var layerSetRef = app.activeDocument.layerSets.getByName("myParentSet");
var childSet = layerSetRef.layerSets.getByName("myChildSet");
Properties
Methods
LayerSets sample script
The following script creates three layer sets, then nests a second layer set in each layer set, and then
creates a text layer in each nested set that that displays the text "Layer in n Set Inside n Set", where n
represents the ordinal number of the set (first, second, or third).
Note: This script uses the ExtendScript
$ debugging object. For further details, see the JavaScript Tools
Guide.
LayerSets.jsx
$.level = 1
//close all open documents
while (app.documents.length) {
Property Value type What it is
length
number
Read-only. The number of elements in the LayerSets
collection.
parent
Document or
LayerSet
Read-only. The containing document or layer set.
typename
string
Read-only. The class name of the referenced layerSets
object.
Method Parameter type Returns What it does
add
()
LayerSet
Creates a new layer set object and adds it to
the collection.
getByName
(name)
string
LayerSet
Gets the first element in the collection with
the provided name.
removeAll
()
Removes all member layer sets, and any
layers or layer sets they contain, from the
document.
Page view 130
1 2 ... 126 127 128 129 130 131 132 133 134 135 136 ... 230 231

Comments to this Manuals

No comments