Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 47

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
JS
var fileRef = new File("//MyFile")
var docRef = app.open (fileRef)
Notice that in JavaScript, you must create a
command.
open()
For the document types on the following list, you can set options to specify how the document will be
opened, such as the height and width of the window in which the document is opened, which page to
open to in a multi-page file, etc.
PhotoCD
CameraRaw
RawFormat
Adobe PDF
EPS
To find out which options you can set for each of file type, look up the properties for the OpenOptions
objects that begin with the file format name. For example:
In the Adobe Photoshop CS2 AppleScript Scripting Reference look up the
or the
In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript
Scripting Reference, look up the
The following examples demonstrate how to open a generic (multi-page/multi-image) PDF document
with the following specifications:
The document will open in a window that is 100 pixels high and 200 pixels wide.
The document will open in RGB mode with a resolution of 72 pixels/inch.
Antialiasing will be used to minimize the jagged appearance of the edges of images in the document.
The document will open to page 3.
The document's original shape will change to conform to the height and width properties if the
original shape is not twice as wide as it is tall.
AS
tell application "Adobe Photoshop CS2"
set myFilePath to alias "Applications:PDFFiles:MyFile.pdf"
open myFilePath as PDF with options ¬
end tell
VBS
Dim appRef
Set appRef = CreateObject("Photoshop.Application")
'Remember unit settings and set to values expected by this script
Dim originalRulerUnits
originalRulerUnits = appRef.Preferences.RulerUnits
appRef.Preferences.RulerUnits = psPixels
EPS open objects class
{class:PDF open options, height:pixels 100, ¬
width:pixels 200, mode:RGB, resolution:72, ¬
use antialias:true, page:3, ¬
constrain proportions:false}
Photoshop CS2
object and then pass a reference to the object to the
File
.
or
PhotoCDOpenOptions
Scripting Photoshop CS2
Photo CD open options class
objects.
EPSOpenOptions
43

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents