Setting The Active Document - Adobe 65014912 Manual

Photoshop cs4 extended
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
N
: The parent object is the object that contains the specified object. For example, the application is the
OTE
parent of the document; a document is the parent of a layer, selection, or channel.
For example, if you look at the
Reference, or in the ExtendScript Object Model Viewer, you find one of its properties is
you look at the
Similarly, if you look at
Photoshop AppleScript Dictionary, you find it has the property of
For sample scripts that set active objects, see the following sections.
"Setting the active document" on page 26
"Setting the active layer" on page 27
"Setting the active channels" on page 28

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
Application
object, you will find
Document
in the Adobe Photoshop CS4 AppleScript Scripting Reference, or in the
application
object in the Adobe Photoshop CS4 JavaScript Scripting
and
activeLayer
activeHistoryState
current
Setting the Active Object 26
activeDocument
as properties.
, and so on.
; if

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents