Adobe 65048599 Scripting Guide - Page 29

Specifying file formats to open, Open Classes - pdf

Page 29 highlights

CHAPTER 3: Scripting Photoshop Opening a Document 29 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 File object and then pass a reference to the object to the open() command. Specifying file formats to open Open Classes Open Options Photo CD Open Options Raw Format Open Options Camera Raw Open Options EPS Open Options PDF Open Options 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 CS5 AppleScript Scripting Reference look up the Photo CD open options class or the EPS open objects class. ➤ In the Adobe Photoshop CS5 Visual Basic Scripting Reference, or the Adobe Photoshop CS5 JavaScript Scripting Reference, look up the PhotoCDOpenOptions or EPSOpenOptions objects. The following examples demonstrate how to open a generic (multi-page/multi-image) PDF document with the following specifications: ➤ 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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87

C
HAPTER
3: Scripting Photoshop
Opening a Document
29
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
File
object and then pass a reference to the object to the
open()
command.
Specifying file formats to 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 CS5 AppleScript Scripting Reference
look up the
Photo
CD
open
options
class or
the
EPS
open
objects
class.
In the
Adobe Photoshop CS5 Visual Basic Scripting Reference
, or the
Adobe Photoshop CS5 JavaScript
Scripting Reference
, look up the
PhotoCDOpenOptions
or
EPSOpenOptions
objects.
The following examples demonstrate how to open a generic (multi-page/multi-image) PDF document
with the following specifications:
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.
Open Classes
Open
Options
Camera
Raw
Raw
Photo CD
Open
Options
Format
Open
Options
Open
Options
EPS
Open
Options
PDF
Open
Options