Adobe 65010248 Scripting Guide - Page 24

Dynamic objects, Symbols, Transformations

Page 24 highlights

CHAPTER 2: The Illustrator Scripting Object Model Dynamic objects 24 Dynamic objects By creating dynamic objects, you can create data-driven graphics. In the Illustrator application, you use the Variables panel to create or edit variables like graph data, linked file, text string, and visibility, or variables whose type is not specified. In scripting, you use the variable object to represent this type of variable. The variable object's kind property indicates the type of dynamic data that a variable object holds. variable objects are document-level objects; you create them in a document object. NOTE: Do not confuse variable objects with scripting variables. For details on Illustrator variables, dynamic objects, and data-driven graphics, see Illustrator Help. Datasets, which collect variables and their associated dynamic data into one object, are represented in scripting by the dataset object. The dataset object provides methods to update and delete dataset objects in your scripts. Symbols In Illustrator, symbols are art items that are stored in the Symbols panel. Your scripts can create, delete, and duplicate symbol objects. When you create symbol objects in your script, Illustrator adds them to the Symbols panel for the target document. A symbol item is an instance of a symbol object in a document. Each symbol item is linked to its symbol definition, so changing the definition of a symbol updates all instances of the symbol. Your script can create, delete, and duplicate symbol items. Symbol items are Illustrator art items; therefore, they can be treated in the same way as other art items or page items. You can rotate, resize, select, lock, hide, and perform other operations on symbol items. Transformations The matrix object provides access to the power of geometric-transformation matrices. Transformation matrices in Illustrator store the settings of an operation that scales, rotates, or moves (translates) an object on a page. There are advantages to using matrices: ➤ By storing transformation values in a matrix object, you can use the values repeatedly on different objects in your script. ➤ By concatenating rotation, translation, and/or scaling matrices and applying the resulting matrix, you can perform many geometric transformations with only one script statement. ➤ You can invert matrix values. ➤ You can compare the values of two matrices. The application object. has commands or methods to create, get, invert, compare, or concatenate matrices. The command or method used to apply a matrix is the transform command, which belongs to any type of object on which transformations can be performed.

  • 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
2: The Illustrator Scripting Object Model
Dynamic objects
24
Dynamic objects
By creating dynamic objects, you can create data-driven graphics. In the Illustrator application, you use the
Variables panel to create or edit variables like graph data, linked file, text string, and visibility, or variables
whose type is not specified. In scripting, you use the
variable
object to represent this type of variable.
The
variable
object’s
kind
property indicates the type of dynamic data that a
variable
object holds.
variable
objects are document-level objects; you create them in a
document
object.
N
OTE
:
Do not confuse
variable
objects with scripting variables. For details on Illustrator variables,
dynamic objects, and data-driven graphics, see Illustrator Help.
Datasets, which collect variables and their associated dynamic data into one object, are represented in
scripting by the
dataset
object. The
dataset
object provides methods to update and delete
dataset
objects in your scripts.
Symbols
In Illustrator, symbols are art items that are stored in the Symbols panel. Your scripts can create, delete, and
duplicate
symbol
objects. When you create
symbol
objects in your script, Illustrator adds them to the
Symbols panel for the target document.
A
symbol
item
is an instance of a
symbol
object in a document. Each
symbol
item
is linked to its symbol
definition, so changing the definition of a symbol updates all instances of the symbol.
Your script can create, delete, and duplicate symbol items. Symbol items are Illustrator art items; therefore,
they can be treated in the same way as other art items or page items. You can rotate, resize, select, lock,
hide, and perform other operations on symbol items.
Transformations
The
matrix
object provides access to the power of geometric-transformation matrices. Transformation
matrices in Illustrator store the settings of an operation that scales, rotates, or moves (translates) an object
on a page. There are advantages to using matrices:
By storing transformation values in a
matrix
object, you can use the values repeatedly on different
objects in your script.
By concatenating rotation, translation, and/or scaling matrices and applying the resulting matrix, you
can perform many geometric transformations with only one script statement.
You can invert matrix values.
You can compare the values of two matrices.
The
application
object. has commands or methods to create, get, invert, compare, or concatenate
matrices.
The command or method used to apply a matrix is the
transform
command, which belongs to any type
of object on which transformations can be performed.