Document Object - Adobe 23101764 - Photoshop CS - PC Manual

Scripting guide
Hide thumbs Also See for 23101764 - Photoshop CS - PC:
Table of Contents

Advertisement

Scripting Photoshop
3

Document object

// Get a reference to the file that we want to open
var fileRef = new File(
< a file path > );
// Create a PDF option object
var pdfOpenOptions = new PDFOpenOptions;
pdfOpenOptions.antiAlias = true;
pdfOpenOptions.height = 100;
pdfOpenOptions.width = 200;
pdfOpenOptions.mode = OpenDocumentMode.RGB;
pdfOpenOptions.resolution = 72;
pdfOpenOptions.constrainProportions = false;
// Now open the file
app.open( fileRef, pdfOpenOptions );
// restore unit settings
app.preferences.rulerUnits = originalRulerUnits;
Because Photoshop cannot save all of the format types that it can open, the open document
types may be different from the save document types.
3.9 Document object
After you target the Photoshop application, the next object you will likely target is the
Document object. The Document object can represent any open document in Photoshop.
For example, you could use the Document object to get the active layer, save the current
document, then copy and paste within the active document or between different documents.
3.9.1 Saving documents and save options
Photoshop lets you work with various file formats. It is important to note, however, that the
Open and Save formats are not identical.
Also note that some formats available in scripting require you to install optional file formats.
The optional formats are:
• Alias PIX
• Electric Image
• SGI RGB
• Wavefront RLA
• SoftImage
68
Photoshop CS Scripting Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs

Table of Contents