How to get the length of ArtLayer?
There is 1 artLayer added.we need the artLayer to position the end of the artlyer
How to get the length of artLayers?
-
Mike Hale
How to get the length of artLayers?
There are three collection for layers. They are layers, artLayers, and layerSets. Layers contain both artLayers and layerSets. The other two only contain layers of that kind. There is a set of collections for each level in the layers panel.
So to find the number of artLayers at the top or document level you would use app.activeDocument.artLayers.length. It takes a little more work using Action Manager if you want to collect all the artLayers regardless of how they are nested in layerSets.
So to find the number of artLayers at the top or document level you would use app.activeDocument.artLayers.length. It takes a little more work using Action Manager if you want to collect all the artLayers regardless of how they are nested in layerSets.
-
yangcin
How to get the length of artLayers?
Mike Hale wrote:There are three collection for layers. They are layers, artLayers, and layerSets. Layers contain both artLayers and layerSets. The other two only contain layers of that kind. There is a set of collections for each level in the layers panel.
So to find the number of artLayers at the top or document level you would use app.activeDocument.artLayers.length. It takes a little more work using Action Manager if you want to collect all the artLayers regardless of how they are nested in layerSets.
Thanks too much! Mike
So to find the number of artLayers at the top or document level you would use app.activeDocument.artLayers.length. It takes a little more work using Action Manager if you want to collect all the artLayers regardless of how they are nested in layerSets.
Thanks too much! Mike
-
yangcin
How to get the length of artLayers?
Mike Hale wrote:There are three collection for layers. They are layers, artLayers, and layerSets. Layers contain both artLayers and layerSets. The other two only contain layers of that kind. There is a set of collections for each level in the layers panel.
So to find the number of artLayers at the top or document level you would use app.activeDocument.artLayers.length. It takes a little more work using Action Manager if you want to collect all the artLayers regardless of how they are nested in layerSets.
Hi, Mike , the layer.kind = text. how to get length?
So to find the number of artLayers at the top or document level you would use app.activeDocument.artLayers.length. It takes a little more work using Action Manager if you want to collect all the artLayers regardless of how they are nested in layerSets.
Hi, Mike , the layer.kind = text. how to get length?
-
yangcin
How to get the length of artLayers?
For example:
var msgLayer = app.activeDocument.artLayers.add();
msgLayer.kind = LayerKind.TEXT;
msgLayer.textItem.Justification.LEFT
msgLayer.textItem.contents = '..........';
msgLayer.textItem.font = ....
msgLayer.textItem.size = .....
How to get the length of msgLayer?
var msgLayer = app.activeDocument.artLayers.add();
msgLayer.kind = LayerKind.TEXT;
msgLayer.textItem.Justification.LEFT
msgLayer.textItem.contents = '..........';
msgLayer.textItem.font = ....
msgLayer.textItem.size = .....
How to get the length of msgLayer?
-
Mike Hale
How to get the length of artLayers?
There is not a length property for text layers. What you can do is get the textLayer.contents property which is a string then use the string.length property to determine the number of charters is the contents.
msgLayer.textItem.contents.length;// uses the String.length property
msgLayer.textItem.contents.length;// uses the String.length property