Adobe 23101335 - Photoshop - PC Manual page 59

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

Advertisement

Scripting Photoshop
3
Layer objects
VB:
Dim appRef As Photoshop.Application
Set appRef = CreateObject("Photoshop.Application")
' Create a new art layer at the beginning of the current document
Dim docRef As Photoshop.Document
Dim layerObj As Photoshop.ArtLayer
Set docRef = appRef.ActiveDocument
Set layerObj = appRef.ActiveDocument.ArtLayers.Add
layerObj.Name = "MyBlendLayer"
layerObj.BlendMode = psNormalBlend
' Select all so we can apply a fill to the selection
appRef.ActiveDocument.Selection.SelectAll
' Create a color to be used with the fill command
Dim colorObj As Photoshop.SolidColor
Set colorObj = CreateObject("Photoshop.SolidColor")
colorObj.RGB.Red = 255
colorObj.RGB.Green = 100
colorObj.RGB.Blue = 0
' Now apply fill to the current selection
appRef.ActiveDocument.Selection.Fill colorObj
JS:
// Create a new art layer at the beginning of the current document
var layerRef = activeDocument.artLayers.add();
layerRef.name = "MyBlendLayer";
layerRef.blendMode = BlendMode.NORMAL;
// Select all so we can apply a fill to the selection
activeDocument.selection.selectAll;
// Create a color to be used with the fill command
var colorRef = new SolidColor;
colorRef.rgb.red = 255;
colorRef.rgb.green = 100;
colorRef.rgb.blue = 0;
// Now apply fill to the current selection
activeDocument.selection.fill(colorRef);
59
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