Targeting And Referencing The Application Object; Creating New Objects In A Script - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
To view the VBS object library:
1. Start Word, and then choose Tools > Macro > Visual Basic Editor.
2. Choose Tools > References., and then select the Adobe Photoshop CS2 Type Library check box and
click OK.
3. Choose View > Object Browser.
4. Choose Photoshop CS2 type library from the list of open libraries shown in the top-left pull-down
menu.
5. Choose an object class to display more information abut the class.

Targeting and Referencing the Application Object

Because you run your AppleScript and VBScript scripts from outside the Photoshop CS2 application, the
first thing your script should do is indicate that the commands/methods be executed in Photoshop CS2.
Note:
In JavaScript, you do not need to target the
the Photoshop CS2 application itself. (See
page 24
AS
To target Photoshop CS2 in AppleScript, you must enclosing your script in the following statements:
tell application "Adobe Photoshop CS2"
...
end tell
Note:
Because you include all commands in the
Application
VBS
In VBScript, you can do any of the following to target the application:
Dim appRef
Set appRef = CreateObject("Photoshop.Application")
JS
In JavaScript, because you do not need to reference an
the application are accessible without any qualification. You can reference the application as part of the
containment hierarchy or leave it out, whichever makes your scripts easier for you to read. The following
statements are equivalent:
var docRef = app.documents[1]
and
var docRef=documents[1]
Note:
JavaScript samples throughout this guide do not reference the

Creating New Objects in a Script

To create a new document in the Photoshop CS2 application, you select File > New. To create other types
of objects within a document, such as a layer, channel, or path, you use the Window menu or choose the
.)
object throughout the script.
Photoshop CS2
Application
'Creating and Running a JavaScript' on
block, there is no need to reference the
tell
Application
Scripting Photoshop CS2
object because you open the scripts from
object, all properties and methods of
object.
Application
37

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents