Opening A Document; Opening A File With Default File Format - Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Scripting guide
Table of Contents

Advertisement

Adobe Photoshop CS3 Scripting Guide
' This example assumes docRef is already the ActiveDocument
Dim theChannels
theChannels = Array(docRef.Channels(0), docRef.Channels(2))
docRef.ActiveChannels = theChannels
Alternatively, select all component channels using the
object:
appRef.ActiveDocument.ActiveChannels= _
appRef.ActiveDocument.ComponentChannels
JS
Set the active channels to the first and third channel using a channel array:
theChannels = new Array(docRef.channels[0], docRef.channels[2])
docRef.activeChannels = theChannels
Alternatively, select all component channels by using the
object:
app.activeDocument.activeChannels =
activeDocument.componentChannels

Opening a Document

You use the
must specify the document name (that is, the path to the file that contains the document) with the
command.

Opening a File with Default File Format

Because Photoshop CS3 supports many different file formats, the
specify the format of the document you are opening. If you do not specify the format, Photoshop CS3
infers the type of file for you, which is called the file's default format. The following examples open a
document by inferring the most appropriate format to use:
AS
set theFile to alias "Applications:Documents:MyFile"
open theFile
VBS
fileName = "C:\MyFile"
Set docRef = appRef.Open(fileName)
JS
var fileRef = File(app.path + "/Samples/Fish.psd")
var docRef = app.open(fileRef)
Notice that in JavaScript, you must create a
command.
open()
/
/
command of the
open
Open
open()
Photoshop CS3
ComponentChannels
componentChannels
Application
object and then pass a reference to the object to the
File
Scripting Photoshop CS3
property of the
property of the
object to open an existing document. You
command lets you
open/Open/open()
26
Document
Document

Advertisement

Table of Contents
loading

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents