Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting Photoshop CS2 48
●
JS:
var fontstInstalled = app.fonts
●
The amount of unused memory available to Adobe Photoshop CS2.
●
The location of the Presets folder.
Note:
See
‘Creating and Running a JavaScript’ on page 24
for information on the Presets
folder.
Using the Document Object
The
Document
object can represent any open document in Photoshop CS2. You can think of a
Document
object as a file; you can also think of it as a canvas. You work with the
Document
object to do the following:
●
Access script objects contained in the
Document
object, such as
ArtLayer
or
Channel
objects. See
‘Containment Hierarchy’ on page 8
and
‘Photoshop CS2’s Object Model’ on page 8
for
more information.
●
Manipulate a specific
Document
object. For example, you could crop, rotate or flip the canvas, resize the
image or canvas, and trim the image. See
‘Manipulating a Document Object’ on page 48
for a
demonstration.
●
Get the active layer. See
‘Setting the Active Layer’ on page 41
.
●
Save the current document. See
‘Saving a Document’ on page 44
.
●
Copy and paste within the active document or between different documents. See
‘Understanding
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
‘Setting
Application Preferences’ on page 46
for information on ruler units.
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
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...