Adobe 23101335 - Photoshop - PC Manual page 60

Scripting guide
Hide thumbs Also See for 23101335 - Photoshop - PC:
Table of Contents

Advertisement

Scripting Photoshop
3
Layer objects
The following examples show how to create a layer set after the first layer in the current
document:
AS:
tell application "Adobe Photoshop 7.0"
make new layer set after layer 1 of current document
end tell
VB:
Dim appRef As Photoshop.Application
Set appRef = CreateObject("Photoshop.Application")
' Get a reference to the first layer in the document
Dim layerRef As Photoshop.Layer
Set layerRef = appRef.ActiveDocument.Layers(1)
' Create a new LayerSet (it will be created at the beginning of the
' document)
Dim newLayerSetRef As Photoshop.LayerSet
Set newLayerSetRef = appRef.ActiveDocument.LayerSets.Add
' Move the new layer to after the first layer
newLayerSetRef.MoveAfter layerRef
JS:
// Get a reference to the first layer in the document
var layerRef = activeDocument.layers[0];
// Create a new LayerSet (it will be created at the beginning of the
// document)
var newLayerSetRef = activeDocument.layerSets.add();
// Move the new layer to after the first layer
newLayerSetRef.moveAfter( layerRef );
An existing art layer can also be changed to a text layer if the existing layer is empty.
Conversely you can change a text layer to a normal layer. When you do this the text in the
layer is rasterized.
60
Photoshop 7.0 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop 7.0

Table of Contents