Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 52

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
JS:
The amount of unused memory available to Adobe Photoshop CS2.
The location of the Presets folder.
Note:
Using the Document Object
The
Document
object as a file; you can also think of it as a canvas. You work with the
Access script objects contained in the
'Containment Hierarchy' on page 8
more information.
Manipulate a specific
image or canvas, and trim the image. See
demonstration.
Get the active layer. See
Save the current document. See
Copy and paste within the active document or between different documents. See
Clipboard Interaction' on page 66
Manipulating a Document Object
The following examples demonstrate how to do the following:
Change the size of the image to 4 inches wide and 4 inches high.
Change the size of the document window (or canvas) to 5 inches high and 6 inches wide.
Trim the top and bottom of the image.
Crop the image.
Flip the entire window.
Note:
The following examples assume the ruler units have been set to inches. See
Application Preferences' on page 46
AS
--this script sample assumes the ruler units have been set to inches
resize image current document width 4 height 4
resize canvas current document width 4 height 4
trim current document basing trim on top left pixel ¬
with top trim and bottom trim without left trim and right trim
--the crop command uses unit values
--change the ruler units to pixels
set ruler units of settings to pixel units
crop current document bounds {10, 20, 40, 50} angle 45 ¬
resolution 72 width 20 height 20
flip canvas current document direction horizontal
var fontstInstalled = app.fonts
See
'Creating and Running a JavaScript' on page 24
folder.
object can represent any open document in Photoshop CS2. You can think of a
Document
'Setting the Active Layer' on page 41
Photoshop CS2
object, such as
Document
and
'Photoshop CS2's Object Model' on page 8
object. For example, you could crop, rotate or flip the canvas, resize the
'Manipulating a Document Object' on page 48
'Saving a Document' on page 44
.
for information on ruler units.
Scripting Photoshop CS2
for information on the Presets
object to do the following:
Document
or
objects. See
ArtLayer
Channel
.
.
'Understanding
'Setting
48
Document
for
for a

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents