Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 44

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
In VBScript, you use the
ActiveLayer
In JavaScript, you use the
activeLayer
Note:
The parent object is the object that contains the specified object. For example, the application is the
parent of the document; a document is the parent of a layer, selection, or channel.
For example, if you search for
Reference,you will find it is a property of the
activeHistoryState
search for
find it is a property of the
For sample scripts that set active objects, see the following sections.
'Setting the Active Document' on page 40
'Setting the Active Layer' on page 41
'Setting the Active Channels' on page 41
Setting the Active Document
The following examples demonstrate how to set the active document.
AS
--create 2 documents
set docRef to make new document with properties ¬
{width:4 as inches, height:4 as inches}
set otherDocRef to make new document with properties¬
{width:4 as inches, height:6 as inches}
--make docRef the active document
set current document to docRef
--here you would include command statements
--that perform actions on the active document. Then, you could
--make a different document the active document
--use the current document property of the application class to
--bring otherDocRef front-most as the new active document
set current document to otherDocRef
VBS
'Create 2 documents
Set docRef = app.Documents.Add ( 4, 4)
Set otherDocRef = app.Documents.Add (4,6)
'make docRef the active document
Set app.activeDocument = docRef
'here you would include command statements
'that perform actions on the active document. Then, you could
'make a different document the active document
'use the ActiveDocument property of the Application object to
'bring otherDocRef front-most as the new active document
Set app.ActiveDocument = otherDocRef
Photoshop CS2
Object
Active
).
Object
active
).
activeDocument
, you will find they are properties of the
document in the Adobe Photoshop CS2 AppleScript Scripting Reference, you will
current
Class application
property of the parent object (such as
property of the parent object (such as
in the Adobe Photoshop CS2 JavaScript Scripting
object; if you search for
Application
, and so on.
Scripting Photoshop CS2
ActiveDocument
activeDocument
activeLayer
object. Similarly, if you
Document
40
or
or
or

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents