Adobe 65010248 Scripting Guide - Page 14

contains all, objects in a document. It has two

Page 14 highlights

CHAPTER 1: Introduction Changes since CS3 14 ➤ Two new methods were added to the Document class. WindowCapture captures the current document to a TIFF image. Rasterize rasterizes the source art within a specified clip bounds. ➣ AppleScript - capture document 1, rasterize document 1 ➣ JavaScript - app.activeDocument.windowCapture, app.activeDocument.rasterize ➣ VBScript - App.ActiveDocument.WindowCapture, App.ActiveDocument.Rasterize ➤ A new method in the Swatches collection, GetSelected, returns a SwatchList of Swatch objects currently selected. ➣ AppleScript - get selected swatches of document 1 ➣ JavaScript - app.activeDocument.swatches.getSelected ➣ VBScript - App.ActiveDocument.Swatches.GetSelected ➤ A new class, SwatchGroup, contains a group of Swatch objects. It has two methods: GetAllSwatches and AddSwatch. ➣ AppleScript - swatch group 1 of document 1 ➣ JavaScript - app.activeDocument.swatchGroups[0] ➣ VBScript - App.ActiveDocument.SwatchGroups(1) ➤ A new collection, SwatchGroups, contains all SwatchGroup objects in a document. It has two methods: Remove and Add. ➣ AppleScript - swatch groups in document 1 ➣ JavaScript - app.activeDocument.swatchGroups ➣ VBScript - App.ActiveDocument.SwatchGroups ➤ A new type, SwatchList, defines a collection of Swatch objects. It is used by the SwatchGroup object and Swatches collection. ➤ A new property in the GradientStop class, opacity, allows each stop to define its own degree of transparency. Alpha blending occurs between stops. ➣ AppleScript - stop opacity of gradient stop ➣ JavaScript - gradientStop.opacity ➣ VBScript - GradientStop.Opacity ➤ A new property in the OpenOptionsAutoCAD class, MergeLayers, defines whether the layers in the AutoCAD file being opened should be merged into a single layer in the Illustrator document. ➣ AppleScript - merge layers: true ➣ JavaScript - mergeLayers = true ➣ VBScript - MergeLayers = true

  • 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

C
HAPTER
1: Introduction
Changes since CS3
14
Two new methods were added to the
Document
class.
WindowCapture
captures the current document
to a TIFF image.
Rasterize
rasterizes the source art within a specified clip bounds.
AppleScript —
capture
document
1
,
rasterize
document
1
JavaScript —
app.activeDocument.windowCapture,
app.activeDocument.rasterize
VBScript —
App.ActiveDocument.WindowCapture,
App.ActiveDocument.Rasterize
A new method in the
Swatches
collection,
GetSelected
, returns a
SwatchList
of
Swatch
objects
currently selected.
AppleScript —
get
selected
swatches
of
document
1
JavaScript —
app.activeDocument.swatches.getSelected
VBScript —
App.ActiveDocument.Swatches.GetSelected
A new class,
SwatchGroup
, contains a group of
Swatch
objects. It has two methods:
GetAllSwatches
and
AddSwatch
.
AppleScript —
swatch
group
1
of
document
1
JavaScript —
app.activeDocument.swatchGroups[0]
VBScript —
App.ActiveDocument.SwatchGroups(1)
A new collection,
SwatchGroups
, contains all
SwatchGroup
objects in a document. It has two
methods:
Remove
and
Add
.
AppleScript —
swatch
groups
in
document
1
JavaScript —
app.activeDocument.swatchGroups
VBScript —
App.ActiveDocument.SwatchGroups
A new type,
SwatchList
, defines a collection of
Swatch
objects. It is used by the
SwatchGroup
object
and
Swatches
collection.
A new property in the
GradientStop
class,
opacity
, allows each stop to define its own degree of
transparency. Alpha blending occurs between stops.
AppleScript —
stop
opacity
of
gradient
stop
JavaScript —
gradientStop.opacity
VBScript —
GradientStop.Opacity
A new property in the
OpenOptionsAutoCAD
class,
MergeLayers
, defines whether the layers in the
AutoCAD file being opened should be merged into a single layer in the Illustrator document.
AppleScript —
merge
layers:
true
JavaScript —
mergeLayers
=
true
VBScript —
MergeLayers
=
true