If this guide is distributed with software that includes an end user agreement, this guide, as well as the software
described in it, is furnished under license and may be used or copied only in accordance with the terms of such license.
Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written
permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law
even if it is not distributed with software that includes an end user license agreement.
The content of this guide is furnished for informational use only, is subject to change without notice, and should not be
construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or
liability for any errors or inaccuracies that may appear in the informational content contained in this guide.
Please remember that existing artwork or images that you may want to include in your project may be protected under
copyright law. The unauthorized incorporation of such material into your new work could be a violation of the rights of
the copyright owner. Please be sure to obtain any permission required from the copyright owner.
Any references to company names in sample templates are for demonstration purposes only and are not intended to
refer to any actual organization.
Adobe, the Adobe logo, Acrobat, Flash, Illustrator, Macromedia, and Photoshop are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Macintosh is a trademark of Apple Computer, Incorporated, registered in the United States and other countries. Windows
is either a registered trademark or trademark of Microsoft Corporation in the United States and other countries.
JavaScript and all Java-related marks are trademarks or registered trademarks of Sun Microsystems, Incorporated in the
United States and other countries.
All other trademarks are the property of their respective owners.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice to U.S. Government End Users.
The Software and Documentation are “Commercial Items,” as that term is defined at 48 C.F.R. §2.101, consisting of
“Commercial Computer Software” and “Commercial Computer Software Documentation,” as such terms are used in 48
C.F.R. §12.212 or 48 C.F.R. §227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §§227.7202-1 through
227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are
being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted
to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright
laws of the United States. Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For U.S.
Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the
provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act
of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR
Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and regulations contained in the preceding
sentence shall be incorporated by reference.
This reference section describes the objects and methods in the Illustrator VBScript type library. All of the
classes in the type library are presented alphabetically. The chapter concludes with an enumerations
reference which lists all of the enumerations in the Illustrator type library.
Each class listing includes the following:
Properties of the class — These include value type, read-only status, and an explanation.
Methods for the class — Value types needed by the method are shown in bold face. Enumerated
values are linked to the Chapter 2, “Enumerations Reference
All items surrounded by brackets (
Script examples — These example are intended to illustrate concepts, and do not necessarily
represent the best or most efficient way to construct a VBScript script. They contain little error
checking, and assume that the proper context exists for the scripts to execute in (for instance, that
there is a document open or items selected).
Each script contains a single subroutine that can be pasted into any event in a VBScript form if you are
using the VBScript development environment. A standard button click event is used for all examples. If
you are using a built-in VBScript editor in a VBA application, you can paste the script into a macro
routine. In either case, modify the
[ ]) are optional.
Sub statement in the example to work with your situation.
.” Required terms are shown in plain face.
For an overview of how the Illustrator object model is structured, see Adobe Illustrator CS6 Scripting Guide.
7
CHAPTER 1: VBScript Object ReferenceApplication 8
Application
The Adobe Illustrator application object, which contains all other Illustrator objects.
Application properties
PropertyValue typeWhat it is
ActionIsRunningBoolean
ActiveDocumentDocument
ApplicationApplication
BrowserAvailableBoolean
BuildNumberString
ColorSettingsListVariant
CoordinateSystem
DefaultColorSettingsString
DocumentsDocuments
FlattenerPresetsListVariant
FreeMemoryLong
LocaleString
AiCoordinateSystem
Read-only. If true, an action is still running.
The active (frontmost) document in Illustrator.
Read-only. The Illustrator Application object.
Read-only. If true, a Web browser is available.
Read-only. The application’s build number.
Read-only. The list of color-settings files
currently available for use.
The coordinate system currently in use,
document or artboard.
Read-only. The default color-settings file for the
current application locale.
Read-only. The documents in the application.
Read-only. The list of flattener style names
currently available for use.
Read-only. The amount of unused memory (in
bytes) within the Illustrator partition.
Read-only. The application’s locale.
NameString
PathString
PDFPresetsList
PPDFileList
PreferencesPreferences
PrinterListVariant
PrintPresetsListVariant
ScriptingVersionString
Variant Array of
String
Variant Array of
Strings
Read-only. The application’s name (not related to
the filename of the application file).
Read-only. The file path to the application.
Read-only. The list of preset PDF-options names
available for use.
Read-only. The list of PPD files currently available
for use.
Read-only. The application preferences.
Read-only. A list of available printers.
Read-only. The list of preset printing-options
names currently available for use.
Read-only. The version of the Scripting plug-in.
CHAPTER 1: VBScript Object ReferenceApplication 9
PropertyValue typeWhat it is
Selection
StartupPresetsListVariant
TextFontsTextFonts
TracingPresetList
UserInteractionLevelAiUserInteractionL
VersionString
VisibleBoolean
Application methods
MethodReturnsWhat it does
ConcatenateMatrix
(matrix as Matrix,
secondMatrix as Matrix)
Variant
objects
Variant
String
evel
Array of
Array of
All currently selected objects in the active
(frontmost) document.
Read-only. The list of presets available for
creating a new document.
Read-only. The installed fonts.
Read-only. The list of preset tracing-options
names available for use.
The allowed level of interaction with users in the
form of dialogs and message boxes.
Read-only. The version of the Illustrator
application.
Read-only. If true, the application is visible.
Matrix
Concatenates two
matrices.
ConcatenateRotationMatrix
(matrix as Matrix,
angle as Double)
ConcatenateScaleMatrix
(matrix as Matrix,
[, scaleX as Double]
[, scaleY as Double])
ConcatenateTranslationMatrix
(matrix as Matrix,
[, deltaX as Double]
[, deltaY as Double])
ConvertSampleColor
(SourceColorSpace as AiImageColorSpace
SourceColor as ColorComponents,
DestColorSpace as AiImageColorSpace
ColorConvertPurpose as AiColorConvertPurpose
[,SourceHasAlpha as Boolean]
[,DestHasAlpha as Boolean])
Copy
()
Cut
()
,
Matrix
Concatenates a rotation to
a transformation matrix.
Matrix
Concatenates a scale to a
transformation matrix.
Matrix
Concatenates a translation
to a transformation matrix.
,
array of
ColorCom
ponents
Converts a
sample-component color
from one color space to
another.
' Open a document and get the reference to it
Set appRef = CreateObject("Illustrator.Application")
Set docRef = appRef.Open("C:\temp\aFile.ai")
Accessing the selection
In Illustrator, the application’s Selection can be accessed as well as modified. The selection will contain
Empty when there are no selected objects. To deselect all objects in the current document, set the
selection to
Set appRef = CreateObject("Illustrator.Application")
appRef.activeDocument.Selection = Empty
Empty, as the following example shows.
A reference to a text range is returned when there is an active insertion point in the contents of a
TextFrame. Similarly, a reference to a range of text is returned when characters are selected in the
contents of a
TextFrame.
Executing an action
You can run an action from the Action Palette from a script by using the DoScript method. When you do
this, the control returns to your script before the action has completed. Use the
ActionIsRunning
property to test for when the action has completed before executing any other VBScript methods (see the
Windows.DoAction example). You can also use the Sleep method defined on the WScript object to insert
a pause to test this property, as in the following example:
This script uses the application property ActiveDocument to copy the current document’s selection to the
clipboard before pasting it into our new document. This script also demonstrates how to create a new
document with a specific color space and dimensions.
'Duplicates the selected item in the current document to a new document
Set appRef = CreateObject("Illustrator.Application")
If appRef.Documents.Count > 0 Then
If Not IsEmpty(appRef.ActiveDocument.selection) Then
appRef.ActiveDocument.Copy
Set newDocument = appRef.Documents.Add(aiDocumentCMYKColor,250, 400)
newDocument.Paste
End If
End If
CHAPTER 1: VBScript Object ReferenceArtboard 15
Artboard
An Artboard object represents a single artboard in a document. There can be between 1 to 100 artboards
in one document.
Artboard properties
PropertyValue typeWhat it is
ApplicationApplication
ArtboardRectRect
NameString
ParentDocument
RulerOriginPoint
RulerPARDouble
ShowCenterBoolean
ShowCrossHairsBoolean
ShowSafeAreasBoolean
Artboard methods
MethodReturnsWhat it does
Read-only. The Illustrator Application object.
Size and position of the artboard.
The unique identifying name of the artboard.
Read-only. The name of the object that is this Artboard object’s
parent.
Ruler origin of the artboard, relative to the left top corner of the
artboard.
Pixel aspect ratio, used in ruler visualization if the units are pixels.
Range: 0.1 to 10.0
Show center mark.
Show cross hairs.
Show title and action safe areas (for video).
Delete
()
NothingDeletes this artboard object. You cannot remove the last
artboard in a document.
CHAPTER 1: VBScript Object ReferenceArtboards 16
Artboards
A collection of artboards.
Artboards properties
PropertyValue typeWhat it is
ApplicationApplication
CountLong
ParentDocument
Artboards methods
MethodReturnsWhat it does
Add
(rect as ArtboardRect)
GetActiveArtboardIndex
()
GetByName
(artboardName as String)
Index
(item as DataSets)
Insert
(rect as ArtboardRect,
index as Long)
Read-only. The Illustrator Application object.
Read-only. The number of objects in the collection.
Read-only. The document that contains this object.
Artboard
Long
Creates a new Artboard object.
Retrieves the index position of the active artboard in the
document's list. Returns the 0-based index.
Artboard
Retrieves an artboard object from the list by its unique
identifying name.
Long
Returns the index position of the object within the
collection.
NothingCreates a new artboard object and inserts it at the given
index in the list.
Item
(itemKey)
Remove
(index as Long)
SetActiveArtboardIndex
(index as Long)
Artboard
Returns an object reference to the object identified by
itemKey (name or index).
NothingDeletes an artboard object. You cannot remove the last
artboard in a document.
NothingMakes a specific artboard active and makes it current in
'Opens a document and adds a simple text frame, then
'uses the CharacterAttributes object to increment
'the horizontal and vertical scale of each character.
Set appRef = CreateObject("Illustrator.Application")
Set docRef = appRef.Documents.Add()
Set textRef = docRef.TextFrames.Add()
textRef.Contents = "I'd rather be scripting!"
textRef.Top = 500
textRef.Left = 40
dSize = 100
iCount = textRef.Characters.Count
i = 1
Dim charRef
Do While (i < (iCount + 1))
A collection of TextRange objects in which each represents a single character.
Characters properties
PropertyValue typeWhat it is
ApplicationApplication
CountLong
Parent
ObjectRead-only. The object’s container.
Characters methods
MethodReturnsWhat it does
Add
(contents as String
[, relativeObject as TextFrame]
[, insertionLocation as AiElementPlacement
AddBefore
(contents as String)
Read-only. Application that the collection belongs to.
Read-only. Number of elements in the collection.
TextRange
Adds a new character with
specified text contents at
])
the specified location in the
current document. If
location is not specified,
adds the new character to
the containing text frame
after the current text
selection or insertion point.
TextRange
Adds a character before the
current text selection or
insertion point.
Index
(itemPtr as TextRange)
RemoveAll
()
Long
Returns the index position
of the object within the
collection.
NothingDeletes every element in
the collection.
CHAPTER 1: VBScript Object ReferenceCharacters 25
Counting characters
'Counts the number of characters in the current document
'and stores the result in numChars
Set appRef = CreateObject("Illustrator.Application")
If appRef.Documents.Count > 0 Then
numChars = 0
For Each textArt In appRef.ActiveDocument.TextFrames
Set textArtRange = textArt.TextRange
numChars = numChars + textArtRange.length
'Opens a document, adds 3 text frames,
'creates a new character style and applies it to
'each of the text frames
Set appRef = CreateObject("Illustrator.Application")
'Create a new document add a 3 simple text items
Set docRef = appRef.Documents.Add()
Set textRef1 = docRef.TextFrames.Add()
textRef1.Contents = "Scripting is fun!"
textRef1.Top = 700
textRef1.Left = 50
Set textRef2 = docRef.TextFrames.Add()
textRef2.Contents = "Scripting is easy!"
textRef2.Top = 625
textRef2.Left = 100
Set textRef3 = docRef.TextFrames.Add()
textRef3.Contents = "Everyone should script!"
textRef3.Top = 550
textRef3.Left = 150
appRef.Redraw
'Create a new character style
Set charStyle = docRef.CharacterStyles.Add("BigRed")
'Create a red color
Set colorRed = CreateObject("Illustrator.RGBColor")
colorRed.Red = 255
'Set character attributes of the new style
With charStyle.CharacterAttributes
.Size = 40
.Tracking = -50
.Capitalization = 0 'aiNormalCaps
.FillColor = colorRed
End With
'Apply style to each textFrame in the document
charStyle.ApplyTo textRef1.TextRange
charStyle.ApplyTo textRef2.TextRange
charStyle.ApplyTo textRef3.TextRange
CHAPTER 1: VBScript Object ReferenceCMYKColor 29
CMYKColor
A CMYK color specification, used to apply a CMYK color to a layer or art item.
If the color space of a document is RGB and you specify the color value for a page item in that document
using CMYK, Illustrator translates the CMYK color specification into an RGB color specification. The same
thing happens if the document’s color space is CMYK and you specify colors using RGB. Since this
translation can lose information, you should specify colors using the class that matches the document’s
actual color space.
CMYKColor properties
PropertyValue typeWhat it is
ApplicationApplication
BlackDouble
CyanDouble
MagentaDouble
YellowDouble
Read-only. The Illustrator Application object.
The black color value. Range: 0.0 to 100.0
The cyan color value. Range: 0.0 to 100.0
The magenta color value. Range: 0.0 to 100.0
The yellow color value. Range: 0.0 to 100.0
Setting CMYK colors
'Creates a new CMYK color and applies it to the first path item
Set appRef = CreateObject("Illustrator.Application")
Set newCMYKColor = CreateObject("Illustrator.CMYKColor")
'Get a reference to the frontmost path in the document
Set frontPath = appRef.ActiveDocument.PathItems(1)
Compound paths are objects composed of multiple intersecting paths, resulting in transparent interior
spaces where the original paths overlapped. The
make up the compound path.
All paths in a compound path share property values. Therefore, if you set the value of a property of any one
of the paths in the compound path, all other paths’ matching property will be updated to the new value.
Paths contained within a compound path or group in a document are returned as individual paths when a
script asks for the paths contained in the document. However, paths contained in a compound path or
group are not returned when a script asks for the paths in a layer which contains the compound path or
group.
CompoundPathItem properties
PropertyValue typeWhat it is
PathItems property provides access to the paths that
ApplicationApplication
ArtworkKnockoutAiKnockoutState
BlendingModeAiBlendModes
ControlBounds
EditableBoolean
GeometricBounds
HeightDouble
HiddenBoolean
IsIsolatedBoolean
LayerLayer
LeftDouble
LockedBoolean
Variant
4
Doubles
Variant
4
Doubles
Array of
Array of
Read-only. The Illustrator Application object.
Is this object used to create a knockout? If so, what
kind of knockout?
The mode used when compositing an object.
Read-only. The bounds of the object including stroke
width and controls.
Read-only. If true, the object is editable.
Read-only. The bounds of the object excluding
stroke width.
The height of the object, excluding stroke width,
calculated from the
GeometricBounds.
If true, this object is hidden.
If true, this object is isolated.
Read-only. The layer to which this object belongs.
The position of the left side of the item (in points,
measured from the left side of the page).
If true, the object is locked.
NameString
NoteString
OpacityDouble
ParentDocument
PathItemsPathItems
The name of this object.
The note assigned to this object.
The opacity of the object. Range: 0.0 to 100.0
Read-only. The document that contains this object.
Read-only. The path art items in this compound
path.
scaleY as Double,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, changeLineWidths as Double]
[, scaleAbout as AiTransformation
Rotate
(angle as Double,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, rotateAbout as AiTransformation
Transform
(transformationMatrix as Matrix,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, changeLineWidths as Double]
[, transformAbout as AiTransformation
])
])
])
ObjectDuplicates the compound path,
optionally specifying the location
])
and position for the copy.
NothingMoves the object, specifying the
new location and position.
NothingScales the compound path where
scaleX is the horizontal scaling
factor (as a percentage) and
scaleY is the vertical scaling
factor; 100.0 = 100%
NothingRotates the art item relative to the
current rotation. The object is
rotated counter-clockwise if the
Angle value is positive, clockwise
if the value is negative.
NothingTransforms the compound path by
applying the specified
transformation matrix.
Translate
([deltaX as Double]
[, deltaY as Double]
[, transformObjects as Boolean]
[, transformFillPatterns as Boolean]
[, transformFillGradients as Boolean]
[, transformStrokePatterns as Boolean])
ZOrder
(zOrderCmd as AiZOrderMethod
)
NothingRepositions the compound path
relative to the current position,
where
deltaX is the horizontal
offset and
deltaY is the vertical
offset.
NothingArranges the compound path’s
position in the stacking order of
the group or layer (
This example demonstrates how to create a new compound path containing three PathItems. The
example then modifies the stroke of the paths in the compound path. Note that when you modify the
properties of a
The example also shows how to access swatches in a document by name.
'Creates a new compound path item, adds 3 new
'path items, then sets the stroke of the compound path
Set appRef = CreateObject("Illustrator.Application")
Set frontDocument = appRef.ActiveDocument
Set activeLayer = frontDocument.activeLayer
Set newCompoundPath = activeLayer.CompoundPathItems.Add
'Create the path items
Set newPath = newCompoundPath.PathItems.Add
newPath.SetEntirePath Array(Array(30, 50), Array(30, 100))
Set newPath = newCompoundPath.PathItems.Add
newPath.SetEntirePath Array(Array(40, 100), Array(100, 100))
PathItem inside a compound path you affect all paths contained in the compound path.
Set newPath = newCompoundPath.PathItems.Add
newPath.SetEntirePath Array(Array(100, 110), Array(100, 300))
'Set the stroke of the compound path
newPath.Stroked = True
newPath.StrokeWidth = 3.5
newPath.StrokeColor = frontDocument.Swatches(8).Color
Read-only. The number of objects in the collection.
Read-only. The document that contains this object.
Creates a new CompoundPathItem object.
Returns the index position of the object
within the collection.
Returns an object reference to the object
identified by
itemKey (name or index).
'Counts the compound path items in the current document and
'stores in numCPaths
Set appRef = CreateObject("Illustrator.Application")
If appRef.Documents.Count > 0 Then
numCPaths = appRef.ActiveDocument.Layers(1).CompoundPathItems.Count
End If
CHAPTER 1: VBScript Object ReferenceDataSet 37
DataSet
A set of data used for dynamic publishing. A dataset allows you to collect a number of variables and their
dynamic data into one object. To create a
art item.
DataSet object, you must have at least one variable bound to an
For more information, see the VariableAdobe Illustrator CS6 Scripting Guide.
For a sample script that uses a
DataSet properties
PropertyValue typeWhat it is
ApplicationApplication
NameString
ParentDocument
DataSet methods
MethodReturnsWhat it does
Delete
()
NothingDeletes the object.
class and the section on “Dynamic Objects and Symbols” in
DataSet object, see DataSets.
Read-only. The Illustrator Application object.
The name of the DataSet.
Read-only. The name of the object that is this DataSet object’s
parent.
Display
()
Update
()
NothingDisplays the DataSet.
NothingUpdates the DataSet.
CHAPTER 1: VBScript Object ReferenceDataSets 38
DataSets
A collection of DataSet objects.
DataSets properties
PropertyValue typeWhat it is
ApplicationApplication
CountLong
ParentDocument
DataSets methods
MethodReturnsWhat it does
Add
()
Index
(item as DataSets)
Item
(itemKey)
RemoveAll
()
Read-only. The Illustrator Application object.
Read-only. The number of datasets in the collection.
Read-only. The name of the object that is this DataSet object’s
parent.
DataSet
Long
DataSet
Creates a new DataSet object.
Returns the index position of the object within the collection.
Returns an object reference to the object identified by itemKey
(name or index).
NothingDeletes all objects in this collection.
CHAPTER 1: VBScript Object ReferenceDataSets 39
Creating datasets
'Creates two variables (visibility and text),
'creates two datasets using different variable
'values then displays each dataset
Set appRef = CreateObject("Illustrator.Application")
Set docRef = appRef.Documents.Add()
'Create a visibility variable
Set itemRef = docRef.PathItems.Rectangle(600, 200, 150, 150)
Set colorRef = CreateObject("Illustrator.RGBColor")
colorRef.Red = 255
itemRef.FillColor = colorRef
Set visibilityVar = docRef.Variables.Add()
visibilityVar.Kind = 2 'aiVisibility
itemRef.VisibilityVariable = visibilityVar
'Create a text variable
Set textRef = docRef.TextFrames.Add
textRef.Contents = "Text Variable, dataset 1"
textRef.Top = 400
textRef.Left = 200
Set textVar = docRef.Variables.Add
textVar.Kind = 3 'aiTextual
textRef.ContentVariable = textVar
'Create dataset 1
Set ds1 = docRef.DataSets.Add()
'Change data and create dataset 2
itemRef.Hidden = True
textRef.Contents = "Text Variable, dataset 2"
Set ds2 = docRef.DataSets.Add()
'Display datasets
ds1.Display
ds2.Display
CHAPTER 1: VBScript Object ReferenceDocument 40
Document
An Illustrator document. Documents are contained in the Application object.
The default document settings—those properties starting with the word “Default”—are global settings
that affect the current document. Be sure to modify these default properties only when a document is
open. Note that if you set default properties to desired values before creating new objects, you can
streamline your scripts, eliminating the need to specify properties such as
have analogous default properties.
FillColor and Stroked that
A document’s
DocumentColorSpace, Height, and Width can be set only when the document is created.
Once a document is created, these properties cannot be changed.
The frontmost document can be referred to as either
Document properties
PropertyValue typeWhat it is
ActiveDataSetDataSet
ActiveLayerLayer
ActiveViewView
ApplicationApplication
ArtboardsArtboards
BrushesBrushes
CharacterStylesCharacterStyles
AppRef.ActiveDocument or AppRef.Documents(1).
The active DataSet object in the
document.
The active Layer in the document.
Read-only. The document’s current View.
Read-only. The Illustrator Application
object.
Read-only. All artboards in the document.
Read-only. The Brushes contained in the
document.
Read-only. The list of character styles in
this document.
CompoundPathItemsCompoundPathItems
CropBox
Variant
4
CropStyleAiCropOptions
DataSetsDataSet
DefaultFillColorColor info
DefaultFilledBoolean
Array of
Doubles
Read-only. The CompoundPathItems
contained in the document.
The boundary of the document’s cropping
box for output.
A document does not have a default
CropBox. In order to read this property you
have to set the
CropBox first.
The style of the document’s cropping box.
Read-only. A DataSets collection in the
document.
The Color to fill new paths if default filled
is
true.
If true, a new path are filled.
CHAPTER 1: VBScript Object ReferenceDocument 41
PropertyValue typeWhat it is
DefaultFillOverprintBoolean
DefaultStrokeCapAiStrokeCap
DefaultStrokeColorColor info
DefaultStrokedBoolean
DefaultStrokeDashes
DefaultStrokeDashOffsetDouble
DefaultStrokeJoinAiStrokeJoin
DefaultStrokeMiterLimitDouble
Variant
Doubles
Array of
If true, the art beneath a filled object are
overprinted by default.
Default type of line capping for paths
created.
The stroke color for new paths if default
stroked is
true.
If true, the new path are stroked.
The default lengths for dashes and gaps in
dashed lines, starting with the first dash
length, followed by the first gap length,
and so on.
The default distance into the dash pattern
at which the pattern are started for new
paths.
Default type of joints in new paths.
When a default stroke join is set to
mitered, this property specifies when the
join will be converted to beveled
(squared-off) by default. The default miter
limit of
4 means that when the length of
the point reaches four times the stroke
weight, the join switches from a miter join
to a bevel join. Range: 1 to 500; a value of 1
specifies a bevel join.
DefaultStrokeOverprintBoolean
DefaultStrokeWidthDouble
DocumentColorSpaceAiDocumentColorSpace
FullNameString
GeometricBounds
GradientsGradients
GraphicStylesGraphicStyles
GraphItemsGraphItems
Variant Array of
4
Doubles
If true, the art items beneath a stroked
object are overprinted by default.
The default width of stroke for new paths.
Read-only. The color specification system
to use for this document’s color space.
Read-only. The file associated with the
document, which includes the complete
path to the file.
Read-only. The bounds of the illustration
excluding the stroke width of any objects
in the document.
Read-only. The Gradients collection
contained in the document.
Read-only. The GraphicStyles contained
in the document.
Read-only. The GraphItems collection
contained in the document.
CHAPTER 1: VBScript Object ReferenceDocument 42
PropertyValue typeWhat it is
GroupItemsGroupItems
HeightDouble
InkListVariant Array
KinsokuSetObject
LayersLayers
LegacyTextItemsLegacyTextItems
MeshItemsMeshItems
MojikumiSet
NameString
ObjectRead-only. A list of predefined Mojikumi
Read-only. The GroupItems collection
contained in the document.
Read-only. The height of the document,
calculated from the
GeometricBounds.
Read-only. The list of inks in this document.
Read-only. The Kinsoku set of characters
that cannot begin or end a line of Japanese
text.
Read-only. The layers contained in the
document.
Read-only. The legacy text items in the
document.
Read-only. The mesh art items contained in
the document.
sets that specify the spacing for the layout
and composition of Japanese text.
Read-only. The document’s name (not the
complete file path to the document).
NonNativeItemsNonNativeItems
OutputResolutionDouble
PageItemsPageItems
PageOrigin
Variant
2
ParagraphStylesParagraphStyles
ParentApplication
PathString
PathItemsPathItems
PatternsPatterns
Array of
Doubles
Read-only. The non-native art items in this
document.
Read-only. The current output resolution
for the document in dots per inch (dpi).
Read-only. The PageItems (contains all art
item classes) contained in the document.
The zero-point of the page in the
document without margins, relative to the
overall height and width.
Read-only. The list of paragraph styles in
this document.
Read-only. The application that contains
this document.
Read-only. The file associated with the
document, which includes the complete
path to the file.
Read-only. The PathItems contained in
this document.
Read-only. The patterns contained in this
document.
CHAPTER 1: VBScript Object ReferenceDocument 43
PropertyValue typeWhat it is
PlacedItemsPlacedItems
PluginItemsPluginItems
PrintTilesBoolean
RasterEffectSettingsRasterEffectOptions
RasterItemsRasterItems
RulerOrigin
Variant
2
RulerUnitsAiRulerUnits
SavedBoolean
Selection
Variant
Array of
Doubles
Array of
objects
Read-only. The PlacedItems contained in
this document.
Read-only. The PluginItems contained in
this document.
Read-only. If true, this document is tiled
when printed.
The document’s raster effect settings.
Read-only. The raster items contained in
this document.
The zero-point of the rulers in the
document relative to the bottom left
corner.
Read-only. The default measurement units
for the rulers in the document.
If true, the document has not been
changed since the last time it was saved.
The array of references to the objects in
this document’s current selection.
ShowPlacedImagesBoolean
SplitLongPathsBoolean
SpotsSpots
StationeryBoolean
StoriesStories
SwatchesSwatches
SwatchGroupsSwatchGroups
SymbolItemsSymbolItems
SymbolsSymbols
TagsTags
Read-only. If true, placed images are
displayed in the document.
Read-only. If true, long paths are split
when printing.
Read-only. The SpotColors contained in
this document.
Read-only. If true, the file is a stationery
file.
Read-only. The story items in this
document.
Read-only. The swatches in this document.
Read-only. The swatch groups in this
document.
Read-only. The symbol items in this
document.
Read-only. The symbols in this document.
Read-only. The tags in this document.
TextFramesTextFrames
Read-only. The text frames in this
document.
CHAPTER 1: VBScript Object ReferenceDocument 44
PropertyValue typeWhat it is
TileFullPagesBoolean
UseDefaultScreenBoolean
VariablesVariables
VariablesLockedBoolean
ViewsViews
VisibleBounds
WidthDouble
XMPStringString
Document methods
Variant
4
Doubles
Array of
Read-only. If true, full pages are tiled
when printing this document.
Read-only. If true, the printer’s default
screen is used when printing this
document.
Read-only. The variables in this document.
If true, the Variables in this document
are locked.
Read-only. The views in this document.
Read-only. The visible bounds of the
document, including stroke width of any
objects in the illustration.
Read-only. The width of this document,
calculated from the
GeometricBounds.
The XMP metadata packet associated with
this document.
MethodReturnsWhat it does
Activate
()
NothingBrings the first window
associated with the document to
the front.
Close
([Saving as AiSaveOptions
Capture
(ImageFile as File,
windowSize as Point)
ConvertCoordinate
(Coordinate as Point,
Source as AiCoordinateSystem
Destination as AiCoordinateSystem
Copy
()
])
,
)
NothingCloses the document.
NothingCaptures the current document
window to the target TIFF image
file.
NothingConverts the coordinate system
used for a single point between
artboard and document
coordinate systems.
NothingCopies the current selection in
the document to the clipboard;
the associated document must
be the frontmost document.
Cut
()
NothingCuts the current selection in the
document to the clipboard; the
associated document must be
the frontmost document.
CHAPTER 1: VBScript Object ReferenceDocument 45
MethodReturnsWhat it does
Export
(ExportFile as String,
ExportFormat as AiExportType
[Options as Object])
ExportPDFPreset
(File as String)
ExportPerspectiveGridPreset
(File as String)
ExportPrintPreset
(File as String)
ExportVariables
(Filename as String)
FitArtboardToSelectedArt
([Index as Long])
NothingExports the document to the
specified file using one of the
,
export file formats. Options for
various formats are collected in
ExportOptions
Format
objects.
The appropriate file extension is
automatically appended to the
file name, except for Photoshop®
documents. For these, you must
include the file extension (
.psd)
in the file specification.
NothingExports the current PDF preset
values to the file.
NothingExports the current perspective
grid preset values to the file.
NothingExports the current print preset
values to the file.
NothingExports the current variables
from this document to the file.
boolean
Resizes the artboard at the given
index to fit currently selected art.
Index default is 0. Returns
true
on success.
GetPerspectiveActivePlane
()
HidePerspectiveGrid
()
ImageCapture
(ImageFile as File,
[ClipBounds as Rect],
[Options as ImageCaptureOptions
ImportCharacterStyles
(FileSpec as String)
ImportParagraphStyles
(FileSpec as String)
])
AiPerspe
ctiveGri
dPlaneTy
pe
boolean
Retrieves the active plane of the
active perspective grid of the
document.
Hides the current active grid for
the document. If no grid is visible,
does nothing. Returns
true if a
grid is hidden.
NothingCaptures the artwork content
within the clipping boundaries in
this document as a raster image,
and writes the image data to a
specified file.
If the bounds parameter is
omitted, captures the entire
artwork.
NothingLoads the character styles from
the Illustrator file.
NothingLoads the paragraph styles from
the Illustrator file.
CHAPTER 1: VBScript Object ReferenceDocument 46
MethodReturnsWhat it does
ImportPDFPreset
(FileSpec as String
[, ReplacingPreset as Boolean])
ImportPerspectiveGridPreset
(FileSpec as String
[, PerspectivePreset as String])
ImportPrintPreset
(PrintPreset as String
FileSpec as String)
ImportVariables
(Filename as String)
Paste
()
PrintOut
(Options as PrintOptions
Rasterize
(SourceArt as Variant,
[, ClipBounds as Rect,]
[,Options as RasterizeOptions
)
])
NothingLoads all PDF presets from a file.
NothingLoads a named perspective-grid
preset from a file, or, if no name is
given, all presets in the file.
NothingLoads the named print preset
from the file.
NothingImports Variables from the
specified file into this document.
NothingPastes the contents of the
clipboard into the current layer of
the document; if the document is
the frontmost then all pasted
objects remain selected after the
paste.
NothingPrints the document.
PageItem
Rasterizes the source art(s) within
the specified clip bounds. The
source art(s) is disposed of as a
result of the rasterization.
RearrangeArtboards
([ArtboardLayout as AiDocumentArtboardLayout
ArtboardRowsOrCols as Long,
ArtboardSpacing as Long,
ArtboardMoveArtwork as Boolean])
Save
()
boolean
,
Rearranges artboards in the
document. All arguments are
optional. Default layout style is
aiGridByRow.
The second argument specifies
the number of rows or columns,
as appropriate for the chosen
layout style, in the range
[1..DocNumArtboards-1], or 1
(the default) for single
row/column layouts.
Spacing is a number of pixels,
default 20.
When last argument is true (the
default), artwork is moved with
the artboards.
[, width as Double]
[, height as Double]
[, numArtBoards as Long]
[, artboardLayout as AiDocumentArtboardLayout
[, artboardSpacing as Double]
[, artboardRowsOrCols as Long])
AddDocument
(startupPreset as String,
presetSettings as DocumentPreset)
Index
(item as Document)
Read-only. The Illustrator Application object.
Read-only. The number of objects in the collection.
Document
]
Creates a new document
using optional parameters
and returns a reference to
the new document.
]
Document
Creates a document from
the preset, and returns a
reference to the new
document.
Long
Returns the index position
of the object within the
collection.
Item
(itemKey)
Creating a document with a color space
'Creates a new RGB document
Set appRef = CreateObject("Illustrator.Application")
appRef.Documents.Add 1 'aiDocumentRGBColor
Document
Returns an object reference
to the object identified by
Options that may be supplied when saving a document as an Illustrator EPS file. EPSSaveOptions can be
supplied only in conjunction with the
EPSSaveOptions properties
PropertyValue typeWhat it is
document SaveAs method. All properties are optional.
ApplicationApplication
ArtboardRangestring
CMYKPostScriptBoolean
CompatibilityAiCompatibility
CompatibleGradientPrintingBoolean
EmbedAllFontsBoolean
EmbedLinkedFilesBoolean
Read-only. The Illustrator
Application object.
If SaveMultipleArtboards is true,
this is considered for multi-asset
extraction, which specifies the
artboard range. An empty string
extracts all the artboards.
Default: empty string
If true, CMYK PostScript® is used.
Illustrator version compatibility for the
EPS file format.
Default:
15 ' aiIllustrator15
If true, a raster item of the gradient or
gradient mesh are created so the
object can be printed on PostScript
level 2 printers. Default:
false
If true, fonts are included in the EPS
file.
If true, linked image files are included
in the saved document.
FlattenOuputAiOutputFlattening
IncludeDocumentThumbnailsBoolean
OverprintAiPDFOverprint
PostScriptAiEPSPostScriptLevel
Enum
PreviewAiEPSPreview
SaveMultipleArtboardsboolean
How should transparency be flattened
for file formats older than Illustrator 9
or greater.
If true, the thumbnail image of the
EPS artwork is included.
The style of overprinting. Default:
1 ' aiPreservePDFOverprint
Specifies the PostScript level to use
when saving the file.
Format for the EPS preview image.
If true, all artboards or range of
artboards are saved. Default:
Options for exporting a document as an AutoCAD file, used with the Document Export method. All
properties are optional.
When you export a document, the default file extension (DWG) is appended automatically. You should not
include a file extension in the file specification. To override the default AutoCAD export format, use the
ExportFileFormat
ExportOptionsAutoCAD properties
PropertyValue typeWhat it is
property.
AlterPathsForAppearanceBoolean
ApplicationApplication
ColorsAiAutoCADColors
ConvertTextToOutlinesBoolean
ExportFileFormatAiAutoCADExportFileFormat
ExportOptionAiAutoCADExportOption
ExportSelectedArtOnlyBoolean
RasterFormatAiAutoCADRasterFormat
ScaleLineweightsBoolean
If true, paths are altered (if needed)
to maintain appearance.
Default:
false
Read-only. The Illustrator
Application object.
The number of colors to export into
the AutoCAD file.
If true, text is converted to outlines.
Default:
false
The file format to which to export.
Default:
1 'aiDWG
Whether to preserve appearance or
editability during export. Default:
1 ' aiMaximumEditability
If true, only selected artwork is
exported. Default:
false
The format in which to export raster
art.
If true, line weights are scaled by the
same scaling factor as the rest of the
drawing. Default:
Specifies options that you can supply when exporting a document as Macromedia® Flash® (SWF) with the
Document Export method.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
Allproperties are optional.
ExportOptionsFlash properties
PropertyValue typeWhat it is
ApplicationApplication
ArtboardRangestring
ArtClippingAiArtClippingOption
BackgroundColorRGBColor
BackgroundLayers
BlendAnimationAiBlendAnimationType
CompressedBoolean
ConvertTextToOutlinesBoolean
Variant
Array of LayerA list of layers to be included as the static
Read-only. The Illustrator Application
object.
If SaveMultipleArtboards is true, this
is considered for multi-asset extraction,
which specifies the artboard range. An
empty string extracts all the artboards.
Default: empyt string
How the art is clipped during the output.
Default:
1 ' aiOutputArtBounds
The background color of the exported
Flash frames.
background of the exported Flash frames.
How the blend art objects are animated
when exported to Flash frames.
Default:
0 ' aiNoBlendAnimation
If true, the exported file is compressed
when exported. Default:
false
If true, all text is converted to outlines.
Default:
false
CurveQualityLong
ExportAllSymbolsBoolean
ExportStyleAiFlashExportStyle
ExportVersionAiFlashExportVersion
The amount of curve information that is
preserved. Range: 0 to 10, Default:
7
If true, all symbols defined in the palette
are exported. Default:
false
The style in which the exported data are
created in Flash.
Default:
Options that may be supplied when exporting a document as a GIF file. See the Document Export method
for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
ExportOptionsGIF properties
PropertyValue typeWhat it is
AntiAliasingBoolean
ApplicationApplication
ArtBoardClippingBoolean
ColorCountLong
ColorDitherAiColorDitherMethod
ColorReductionAiColorReductionMethod
DitherPercentLong
HorizontalScaleDouble
InfoLossPercentLong
If true, the exported image is anti-aliased.
Default:
true
Read-only. The Illustrator Application object.
If true, the exported image is clipped to the art
board. Default:
false
The number of colors in the exported image’s
color table. Range: 2 to 256. Default:
128
The method used to dither colors in the exported
image. Default:
&H4466736E ' aiDiffusion
The method used to reduce the number of colors
in the exported image.
Default:
&H536C7476 ' aiSelective
The amount that the colors of the exported
image are dithered, where 100.0 is 100%
The horizontal scaling factor applied to the
exported image, where 100.0 is 100%. Default:
100.0
The level of information loss allowed during
compression, where 100.0 is 100%. Default:
0
InterlacedBoolean
MatteBoolean
MatteColorRGBColor
SaveAsHTMLBoolean
TransparencyBoolean
If true, the exported image is interlaced. Default:
false
If true, the art board is matted with a color.
Default:
true
The color to use when matting the art board.
Default:
white
If true, the exported image is saved with an
accompanying HTML file. Default:
false
If true, the exported image uses transparency.
Default:
Options that may be supplied when exporting a document as a JPEG file. See the Document Export
method for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
ExportOptionsJPEG
PropertyValue typeWhat it is
AntiAliasingBoolean
ApplicationApplication
ArtBoardClippingBoolean
BlurAmountDouble
HorizontalScaleDouble
MatteBoolean
MatteColorRGBColor
OptimizationBoolean
QualitySettingLong
SaveAsHTMLBoolean
VerticalScaleDouble
If true, the exported image is anti-aliased. Default: true
Read-only. The Illustrator Application object.
If true, the exported image is clipped to the art board.
Default:
false
The amount of blur to apply to the exported image. Range: 0.0
to 2.0. Default:
0.0
The horizontal scaling factor applied to the exported image,
where 100.0 is 100%. Default:
100.0
If true, the art board is matted with a color. Default: true
The color to use when matting the art board. Default: white
If true, the exported image is optimized for web viewing.
Default:
true
The quality of the exported image. Range: 0 to 100. Default: 30
If true, the exported image is saved with an accompanying
HTML file. Default:
false
The vertical scaling factor applied to the exported image,
where 100.0 is 100%. Default:
Options that may be supplied when exporting a document as an Adobe Photoshop® file. See the
Document Export method for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
All properties are optional.
ExportOptionsPhotoshop properties
PropertyValue typeWhat it is
AntiAliasingBoolean
ApplicationApplication
ArtboardRangestring
EditableTextBoolean
EmbedICCProfileBoolean
ImageColorSpaceAiImageColorSpace
MaximumEditabilityBoolean
ResolutionDouble
SaveMultipleArtboards boolean
If true, the exported image is anti-aliased. Default:
true
Read-only. The Illustrator Application object.
If SaveMultipleArtboards is true, this is
considered for multi-asset extraction, which
specifies the artboard range. An empty string
extracts all the artboards. Default: empty string
If true, text objects are exported as editable text
layers. Default:
true
If true, an ICC profile are embedded in the
exported file. Default:
false
The color space of the exported file.
Default:
aiImageRGB ' 2
If true, preserve as much of the original
document’s structure as possible when exporting.
Default:
true
The resolution of the exported file in dots per inch.
Range: 72 to 2400. Default:
150
If true, all artboards or range of artboards are
saved. Default:
false
WarningsBoolean
WriteLayersBoolean
If true, a warning dialog are displayed because of
conflicts in the export settings. Default:
true
If true, the document layers are preserved in the
exported file. Default:
Options that may be supplied when exporting a document as an 8-bit PNG file. See the Document Export
method for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
ExportOptionsPNG8 properties
PropertyValue typeWhat it is
AntiAliasingBoolean
ApplicationApplication
ArtBoardClippingBoolean
ColorCountLong
ColorDitherAiColorDitherMethod
ColorReductionAiColorReductionMethod
DitherPercentLong
HorizontalScaleDouble
InterlacedBoolean
If true, the exported image is anti-aliased.
Default:
true
Read-only. The Illustrator Application object.
If true, the exported image is clipped to the art
board. Default:
false
The number of colors in the exported image’s
color table. Range: 2 to 256. Default:
128
The method used to dither colors in the exported
image. Default:
&H4466736E ' aiDiffusion
The method used to reduce the number of colors
in the exported image.
Default:
&H536C7476 ' aiSelective
Specifies how much the colors of the exported
image are dithered, where 100.0 is 100%
The horizontal scaling factor applied to the
exported image, where 100.0 is 100%. Default:
100.0
If true, the exported image are interlaced.
Default:
false
MatteBoolean
MatteColorRGBColor
SaveAsHTMLBoolean
TransparencyBoolean
If true, the art board is matted with a color.
Default:
true
The color to use when matting the art board.
Default:
white
If true, the exported image is saved with an
accompanying HTML file. Default:
false
If true, the exported image uses transparency.
Default:
Options that may be supplied when exporting a document as a 24-bit PNG file. See the Document Export
method for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
ExportOptionsPNG24 properties
PropertyValue typeWhat it is
AntiAliasingBoolean
ApplicationApplication
ArtBoardClippingBoolean
HorizontalScaleDouble
MatteBoolean
MatteColorRGBColor
SaveAsHTMLBoolean
TransparencyBoolean
VerticalScaleDouble
If true, the exported image is anti-aliased. Default: true
Read-only. The Illustrator Application object.
If true, the exported image is clipped to the art board.
Default:
false
The horizontal scaling factor applied to the exported image,
where 100.0 is 100%. Default:
100.0
If true, the art board is matted with a color. Default: true
The color to use when matting the art board. Default: white
If true, the exported image is saved with an accompanying
HTML file. Default:
false
If true, the exported image uses transparency. Default: true
The vertical scaling factor applied to the exported image,
where 100.0 is 100%. Default:
Options that may be supplied when exporting a document as a SVG file. See the Document Export method
for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
ExportOptionsSVG properties
PropertyValue typeWhat it is
ApplicationApplication
CompressedBoolean
CoordinatePrecisionLong
CSSPropertiesAiSVGCSSPropertyLocation
DocumentEncodingAiSVGDocumentEncoding
DTDAiSVGDTDVersion
EmbedRasterImagesBoolean
Read-only. The Illustrator
Application object.
If true, the exported file is
compressed. Default:
false
The decimal precision for
element coordinate values.
Range: 1 to 7. Default:
3
Specifies how the CSS
properties of the document are
included in the exported file
Specifies how the text in the
do cu me nt is e nc od ed . D e fa ul t:
' aiASCII
1
The SVG version to which the file
should conform.
Default:
2 ' aiSVG1_1
If true, all raster images
contained in the document are
embedded in the saved file.
FontSubsettingAiSVGFontSubsetting
FontTypeAiSVGFontType
IncludeFileInfoBoolean
IncludeVariablesAndDatasetsBoolean
The font glyphs included in the
export file.
The type of font included in the
exported file. Default:
aiCEFFont
1 '
If true, the XMP (Extensible
Metadata Platform) metadata
are included in the output file.
Default:
Options that may be supplied when exporting a document as a TIFF file. See the Document Export method
for additional details.
When you export a document, the appropriate file extension is appended automatically. You should not
include a file extension in the file specification.
All properties are optional.
ExportOptionsTIFF properties
PropertyValue typeWhat it is
AntiAliasingboolean
If true, the exported image should be anti-aliased.
Default:
ArtboardRangestring
If SaveMultipleArtboards is true, this is
considered for multi-asset extraction, which
specifies the artboard range. An empty string
extracts all the artboards. Default: empty string
ByteOrderAiTIFFByteOrder
ImageColorSpaceAiImageColorSpace
The byte order to use in the new file.
The color space of the exported file.
Default:
IZWCompressionboolean
Resolutionnumber (double)
If true, use IZW compression in the new file.
Resolution of the exported file in dots per inch
(dpi). Range: 72.0 to 2400.0. Default: 150.0
SaveMultipleArtboardsboolean
If true, all artboards or range of artboards are
saved. Default:
Exporting to TIFF format
'Exports the current document as TIFF to dest
'dest contains the full path and file name to save to
true
aiImageRGB ' 2
false
Sub exportFileAsTIFF (dest)
Set appRef = CreateObject("Illustrator.Application")
Set tiffExportOptions = CreateObject("Illustrator.ExportOptionsTIFF")
Specifies options which may be supplied when saving a document as an FXG file. All properties are
optional.
FXGSaveOptions properties
PropertyValue typeWhat it is
ApplicationApplication
ArtboardRangestring
BlendsPolicyAiBlendsExpandPolicy
DownsampleLinkedImagesboolean
FiltersPolicyAiFiltersPreservePolicy
GradientsPolicyAiGradientsPreservePolicy
Read-only. The Illustrator
Application object.
If SaveMultipleArtboards is
true, this is considered for
multi-asset extraction, which
specifies the artboard range. An
empty string extracts all the
artboards. Default: empty string
The policy used by FXG to expand
blends. Default:
AiAutomaticallyConvertBlends
If true, linked images are
downsampled (at 72 dpi).
Default:
false
The policy used by FXG to preserve
filters. Default:
3'aiKeepFiltersEditable
The policy used by FXG to preserve
gradients. Default:
4'aiAutomaticallyConvertGrad
ients
IncludeUnusedSymbolsboolean
PreserveEditingCapabilities boolean
SaveMultipleArtboardsboolean
TextPolicyAiTextPreservePolicy
VersionAiFXGVersion
If true, unused symbols are
included. Default:
false
If true, the editing capabilities of
FXG are preserved. Default:
true
If true, all artboards or range of
artboards are saved. Default:
false
The policy used by FXG to preserve
text. Default:
4'aiAutomaticallyConvertText
The version of the FXG file format
to create.
Default:
2'aiVersion2Pt0
CHAPTER 1: VBScript Object ReferenceGradient 71
Gradient
A gradient definition contained in a document. A script can create new gradients.
Gradient properties
PropertyValue typeWhat it is
ApplicationApplication
GradientStopsGradientStops
NameString
ParentDocument
TypeAiGradientType
Gradient methods
MethodReturnsWhat it does
Delete
()
Creating and applying a gradient
'Creates a new gradient in the current document with 2
'gradient stops, then applies the gradient to the front'most path item
Set appRef = CreateObject("Illustrator.Application")
Set frontDocument = appRef.ActiveDocument
Read-only. The Illustrator Application object.
Read-only. The gradient stops contained in this gradient.
The gradient’s name.
Read-only. The document that contains this gradient.
The kind of the gradient, either radial or linear.
NothingDeletes the object.
'Create a color for both ends of the gradient
Set startColor = CreateObject("Illustrator.RGBColor")
Set endColor = CreateObject("Illustrator.RGBColor")
'Create a new gradient
'new gradients always have 2 stops
Set newGradient = frontDocument.Gradients.Add
newGradient.Name = "Gradient created from script"
newGradient.Type = 1 'aiLinearGradient
'Modify the first gradient stop.
Set locationSpecification = newGradient.GradientStops(1)
'Modify the last gradient stop.
'The MidPoint for the last gradient stop is ignored
Set locationSpecification = newGradient.GradientStops(2)
locationSpecification.RampPoint = 80
locationSpecification.Color = endColor
'construct an Illustrator.GradientColor object referring to the
'newly created gradient
Set ColorOfGradient = CreateObject("Illustrator.GradientColor")
ColorOfGradient.Gradient = newGradient
'now get the frontmost path item and
'apply the new gradient as its fill
Set topPath = frontDocument.PathItems(1)
topPath.Filled = True
topPath.fillColor = ColorOfGradient
A gradient color specification, used in conjunction with the Gradient property of the Color specification.
A script can create a
GradientColor using a reference to an existing gradient in the application. If no
existing gradient object is referenced, a default gradient is supplied. An origin is used to specify the center
point of the gradient in this specific gradient color. Single values are used to specify the gradient vector
angles and lengths. A matrix may be specified to further transform the gradient color.
GradientColor properties
PropertyValue typeWhat it is
AngleDouble
ApplicationApplication
GradientGradient
HiliteAngleDouble
HiliteLengthDouble
LengthDouble
MatrixMatrix
Origin
Variant Array of
2
Doubles
The gradient vector angle in degrees.
Read-only. The Illustrator Application object.
Reference to the object defining the gradient.
The gradient hilite vector angle in degrees.
The gradient hilite vector length.
The gradient vector length.
An additional transformation matrix to manipulate the
gradient path.
The gradient vector origin.
Changing a gradient color
'Creates a new RGB color then applies it as the color
'at the first gradient stop of the first gradient
Set appRef = CreateObject("Illustrator.Application")
Set frontDocument = appRef.Documents.Add(1) ' aiDocumentRGBColor
'Get a reference to the gradient that you want to change
Set firstGradient = frontDocument.Gradients(1)
'Create the new color
Set startColor = CreateObject("Illustrator.RGBColor")
startColor.Red = 0
startColor.Green = 255
startColor.Blue = 0
firstGradient.GradientStops(1).Color = startColor
CHAPTER 1: VBScript Object ReferenceGradients 74
Gradients
A collection of Gradient objects in a document.
Gradients properties
PropertyValue typeWhat it is
ApplicationApplication
CountLong
ParentDocument
Gradients methods
MethodReturnsWhat it does
Add
()
Index
(item as Gradient)
Item
(itemKey)
RemoveAll
()
Removing a gradient
Read-only. The Illustrator Application object.
Read-only. The number of objects in the collection.
Read-only. The parent document of this object.
Gradient
Long
Gradient
Creates a new object
Returns the index position of the object within the collection.
Returns an object reference to the object identified by itemKey
(name or index).
NothingDeletes all objects in this collection.
'Deletes the first gradient in the current document
Set appRef = CreateObject("Illustrator.Application")
Set frontDocument = appRef.ActiveDocument
'Get a reference to the gradient that you want to delete
Set gradientToDelete = frontDocument.Gradients(1)
'Now delete the gradient using the collection
frontDocument.Gradients.Remove gradientToDelete
A gradient stop definition contained in a specific gradient. Represents a point on a gradient that specifies a
color change. For an example, see GradientColor
GradientStop properties
PropertyValue typeWhat it is
.
ApplicationApplication
ColorColor info
MidpointDouble
OpacityDouble
ParentDocument
RampPointDouble
GradientStop methods
MethodReturnsWhat it does
Delete
()
Read-only. The Illustrator Application object.
The color linked to this gradient stop.
The distance between two GradientStops, in percentage.
Range: 13.0 to 87.0
The opacity value for the gradient stop. Range: 0.0 to 100.0
Read-only. The document that contains this gradient stop.
The location of the color in the blend. Range: 0.0 to 100.0,
where 100.0 is 100%
'Adds a new gray gradient stop to an existing gradient
Set appRef = CreateObject("Illustrator.Application")
Set frontDocument = appRef.ActiveDocument
'Get a reference to the gradient that you want to change
Set changeGradient = frontDocument.Gradients(1)
'Get a reference to the gradient stop that is the last one
'before you add a new gradient stop
originalCount = changeGradient.GradientStops.Count
Set lastStop = changeGradient.GradientStops(originalCount)
'add the new gradient stop
Set newStop = changeGradient.GradientStops.Add
'Set the values of the new gradient stop. move the original
'last gradient stop a bit to the left, and
'insert the new gradient stop at the old gradient stop's position
newStop.RampPoint = lastStop.RampPoint
lastStop.RampPoint = lastStop.RampPoint - 10
'Create a new color to apply to the newly created gradient stop
'choose a Gray tint value of 70%
Set newStopColor = CreateObject("Illustrator.GrayColor")
newStopColor.Gray = 70
newStop.Color = newStopColor
Each graphic style defines a set of appearance attributes that you can apply to PageItem objects. Graphic
styles are contained in documents. Scripts cannot create new graphic styles.
GraphicStyle properties
PropertyValue typeWhat it is
ApplicationApplication
NameString
ParentDocument
GraphicStyle methods
MethodReturnsWhat it does
ApplyTo
(artItem as PageItem)
MergeTo
(artItem as PageItem)
Delete
()
Applying a graphic style
This example duplicates and groups the current selection, applying the second graphic style in the
document to the items in the group.
Read-only. The Illustrator Application object.
The GraphicStyle name.
Read-only. The document that contains this object.
NothingApplies the GraphicStyle to a specific art item.
NothingMerges this style into the current styles of a specified art item.
NothingDeletes the object.
'Creates a new group item, adds a duplicate of each
'selected item to the group then applies a graphic style
'to the group
Set appRef = CreateObject("Illustrator.Application")
If appRef.Documents.Count > 0 Then
If Not IsEmpty(appRef.Selection) Then
mySelection = appRef.Selection
endIndex = UBound(mySelection)
startIndex = LBound(mySelection)
Set newGroup = appRef.ActiveDocument.GroupItems.Add
For i = startIndex To endIndex
Set artItem = mySelection(i)
Set dupItem = artItem.Duplicate(newGroup, aiPlaceAtEnd)
appRef.ActiveDocument.GraphicStyles(2).ApplyTo dupItem
A graph artwork item. Scripts cannot create new graph items.
GraphItem properties
PropertyValue typeWhat it is
ApplicationApplication
ArtworkKnockoutAiKnockoutState
BlendingModeAiBlendModes
ContentVariableVariable
ControlBounds
Variant
4
EditableBoolean
GeometricBounds
Variant Array of
4
HeightDouble
HiddenBoolean
IsIsolatedBoolean
Array of
Doubles
Doubles
Read-only. The Illustrator Application object.
Is this GraphItem used to create a knockout, and if
so, what kind.
The mode used when compositing an object.
The content variable bound to this GraphItem.
It is not necessary to set the type of the
ContentVariable before binding. Illustrator
automatically sets the type to
AiGraph.
Read-only. The bounds of the object including stroke
width and controls.
Read-only. If true, the GraphItem is editable.
Read-only. The bounds of the
GraphItem excluding
stroke width.
The height of the GraphItem, calculated on the
GeometricBounds.
If true, this GraphItem is hidden.
If true, this GraphItem is isolated.
LayerLayer
LeftDouble
LockedBoolean
NameString
NoteString
OpacityDouble
ParentLayer or
GroupItem
Position
Variant
2
SelectedBoolean
Array of
Doubles
Read-only. The Layer to which this GraphItem
belongs.
The position of the left side of the GraphItem (in
points, measured from the left side of the page).
If true, this GraphItem is locked.
The name of this GraphItem.
The note assigned to this GraphItem.
The opacity of the GraphItem. Range: 0.0 to 100.0
Read-only. The parent of this GraphItem.
The position (in points) of the top left corner of the
item in the format [x, y]. Does not include stroke
weight.
If true, this GraphItem is selected.
CHAPTER 1: VBScript Object ReferenceGraphItem 81
PropertyValue typeWhat it is
SlicedBoolean
TagsTags
TopDouble
URLString
VisibilityVariableVariable
VisibleBounds
Width Double
WrapInsideBoolean
WrapOffsetDouble
Variant
4
Doubles
Array of
If true, this GraphItem is sliced. Default: false
Read-only. The collection of Tags contained in this
GraphItem.
The position of the top of the item (in points,
measured from the bottom of the page).
The value of the Adobe URL tag assigned to this
GraphItem.
The visibility variable bound to this GraphItem.
It is not necessary to set the type of the
VisibilityVariable before binding. Illustrator
automatically sets the type to
Read-only. The visible bounds of the
AiVisibility.
GraphItem
including stroke width.
The width of the GraphItem, based on the
GeometricBounds.
If true, the text frame object is wrapped inside this
object.
The offset to use when wrapping text around this
object.
WrappedBoolean
ZOrderPositionLong
GraphItem methods
MethodReturnsWhat it does
Copy
()
Cut
()
Delete
()
If true, wrap text frame objects around this object
(text frame must be above the object).
Read-only. The position of this GraphItem within the
stacking order of the
that contains the
GroupItem or Layer (Parent)
GraphItem.
NothingCopies the GraphItem to the
clipboard; the associated document
must be the frontmost document.
NothingCuts the GraphItem to the clipboard;
the associated document must be
the frontmost document.
NothingDeletes the object.
CHAPTER 1: VBScript Object ReferenceGraphItem 82
MethodReturnsWhat it does
Duplicate
([relativeObject as Object],
[insertionLocation as
AiElementPlacement
Move
(relativeObject as Object,
insertionLocation as
AiElementPlacement
Resize
(scaleX as Double,
scaleY as Double,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, changeLineWidths as Double]
[,scaleAbout as AiTransformation
Rotate
(angle as Double,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, rotateAbout as AiTransformation
])
)
])
])
ObjectDuplicates the art item, optionally
specifying the location and position
for the copy.
NothingMoves the art item, specifying the
new location and position.
NothingScales the GraphItem where scaleX
is the horizontal scaling factor and
scaleY is the vertical scaling factor.
100.0 = 100%
NothingRotates the GraphItem relative to the
current rotation; counter-clockwise if
the
Angle value is positive, clockwise
if the value is negative.
Transform
(transformationMatrix as Matrix,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, changeLineWidths as Double]
[, transformAbout as AiTransformation
Translate
([deltaX as Double]
[, deltaY as Double]
[, transformObjects as Boolean]
[, transformFillPatterns as Boolean]
[, transformFillGradients as Boolean]
[, transformStrokePatterns as Boolean])
ZOrder
(zOrderCmd as AiZOrderMethod
)
NothingTransforms the GraphItem by
applying a transformation matrix.
])
NothingRepositions the GraphItem relative
to the current position, where
deltaX is the horizontal offset and
deltaY is the vertical offset.
NothingArranges the GraphItem’s positi o n in
the stacking order of the group or
layer (
Parent) of this object.
CHAPTER 1: VBScript Object ReferenceGraphItem 83
Rotating graph items
'Rotates each graph item in the current document 90 degrees.
Set appRef = CreateObject("Illustrator.Application")
'Rotate each graph item 90 degrees
For Each graphRef In appRef.ActiveDocument.GraphItems
graphRef.Rotate 90
Next
appRef.Redraw
CHAPTER 1: VBScript Object ReferenceGraphItems 84
GraphItems
A collection of GraphItem objects.
GraphItems properties
PropertyValue typeWhat it is
ApplicationApplication
CountLong
ParentDocument
GraphItems methods
MethodReturnsWhat it does
Index
(item as GraphItem)
Item
(itemKey)
RemoveAll
()
Long
GraphItem
Nothing
Read-only. The Illustrator Application object.
Read-only. The number of objects in the collection.
Read-only. The document that contains this object.
Returns the index position of the object within the collection.
Returns an object reference to the object identified by
itemKey (name or index).
Deletes all objects in this collection.
CHAPTER 1: VBScript Object ReferenceGrayColor 85
GrayColor
A grayscale color specification used to apply a gray color to a layer or art item.
GrayColor properties
PropertyValue typeWhat it is
ApplicationApplication
GrayDouble
Read-only. The Illustrator Application object.
The tint of the gray. Range: 0.0 to 100.0, where 0.0 is black and
100.0 is white.
Changing word color to gray
'Sets the fill color of the first word in the document to gray
Set appRef = CreateObject("Illustrator.Application")
Set textColor = CreateObject("Illustrator.GrayColor")
'Get a reference to the first word in the active document
Set text = appRef.ActiveDocument.TextFrames(1).TextRange
Set firstWord = text.Words(1)
A grouped set of art items. Group items can contain all of the same page items that a layer can contain,
including other nested groups.
Paths contained within a group or compound path in a document are returned as individual paths when a
script asks for the paths contained in the document. However, paths contained in a group or compound
path are not returned when a script asks for the paths in a layer which contains the group or compound
path.
GroupItem properties
PropertyValue typeWhat it is
ApplicationApplication
ArtworkKnockoutAiKnockoutState
BlendingModeAiBlendModes
ClippedBoolean
CompoundPathItemsCompoundPathItems
ControlBounds
EditableBoolean
GeometricBounds
GraphItemsGraphItems
GroupItemsGroupItems
Variant Array of
4
Doubles
Variant
4
Array of
Doubles
Read-only. The Illustrator Application object.
Is this object used to create a knockout, and if so,
what kind.
The mode used when compositing an object.
If true, the GroupItem is clipped to the clipping
mask.
Read-only. The CompoundPathItems contained in
GroupItem.
this
Read-only. The bounds of the object including
stroke width and controls.
Read-only. If true, this GroupItem is editable.
Read-only. The bounds of the object excluding
stroke width.
Read-only. The raster items contained in this
GroupItem.
Read-only. The GroupItems contained in this
GroupItem.
HeightDouble
HiddenBoolean
IsIsolatedBoolean
LayerLayer
LeftDouble
LegacyTextItemsLegacyTextItems
LockedBoolean
The height of the GroupItem, based on the
GeometricBounds.
If true, this GroupItem is hidden.
If true, this object is isolated.
Read-only. The layer to which this GroupItem
belongs.
The position of the left side of the GroupItem (in
points, measured from the left side of the page).
Read-only. The legacy text items in the group.
If true, this GroupItem is locked.
CHAPTER 1: VBScript Object ReferenceGroupItem 87
PropertyValue typeWhat it is
MeshItemsMeshItems
NameString
NonNativeItemsNonNativeItems
NoteString
OpacityDouble
PageItemsPageItems
ParentDocument
PathItemsPathItems
PlacedItemsPlacedItems
PluginItemsPluginItems
Position
Variant
2
Array of
Doubles
Read-only. The MeshItems contained in this
GroupItem.
The name of this GroupItem.
Read-only. The non-native art items in this group.
The note assigned to this GroupItem.
The opacity of the object. Range: 0.0 to 100.0
Read-only. The PageItems contained in this
GroupItem.
Read-only. The document that contains this
GroupItem.
Read-only. The PathItems contained in this
GroupItem.
Read-only. The PlacedItems contained in this
GroupItem.
Read-only. The PluginItems contained in this
GroupItem.
The position (in points) of the top left corner of the
item in the format [x, y]. Does not include stroke
weight.
RasterItemsRasterItems
SelectedBoolean
SlicedBoolean
SymbolItemsSymbolItems
TagsTags
TextFramesTextFrames
TopDouble
URLString
VisibilityVariableVariable
VisibleBounds
Variant
4
WidthDouble
Array of
Doubles
Read-only. The RasterItems contained in this
GroupItem.
If true, this GroupItem is selected.
If true, this GroupItem is sliced. Default: false
Read-only. The SymbolItems contained in this
GroupItem.
Read-only. The tags contained in this GroupItem.
Read-only. The TextFrame objects contained in this
GroupItem.
The position of the top of the item (in points,
measured from the bottom of the page).
The value of the Adobe URL tag assigned to this
GroupItem.
The Variable bound to this GroupItem.
Read-only. The visible bounds of the
GroupItem
including stroke width.
The width of the GroupItem, based on the
GeometricBounds.
CHAPTER 1: VBScript Object ReferenceGroupItem 88
PropertyValue typeWhat it is
WrapInsideBoolean
WrapOffsetDouble
WrappedBoolean
ZOrderPositionLong
GroupItem methods
MethodReturnsWhat it does
Copy
()
Cut
()
If true, the text frame object are wrapped inside
this object.
The offset to use when wrapping text around this
object.
If true, wrap text frame objects around this object
(text frame must be above the object).
Read-only. The position of this group item within
the stacking order of the group or layer (
Parent)
that contains this group item.
NothingCopies the GroupItem to the
clipboard; the associated
document must be the frontmost
document.
NothingCuts the GroupItem to the
clipboard; the associated
document must be the frontmost
document.
Delete
()
Duplicate
([relativeObject as Object],
[insertionLocation as AiElementPlacement])
Move
(relativeObject as Object,
insertionLocation as AiElementPlacement
Paste
()
Resize
(scaleX as Double,
scaleY as Double,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, changeLineWidths as Double]
[, scaleAbout as AiTransformation
NothingDeletes the object.
ObjectDuplicates the art item, optionally
specifying the location and
position for the copy.
NothingMoves the art item, specifying the
new location and position.
)
NothingInserts the contents of the
clipboard at the beginning of the
GroupItem. You may only paste
into a group that is contained in
the active document.
NothingScales the art item where scaleX
is the horizontal scaling factor and
scaleY is the vertical scaling
factor; 100.0 = 100%
])
CHAPTER 1: VBScript Object ReferenceGroupItem 89
MethodReturnsWhat it does
Rotate
(angle as Double,
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, rotateAbout as AiTransformation
Transform
(transformationMatrix as Matrix
[, changePositions as Boolean]
[, changeFillPatterns as Boolean]
[, changeFillGradients as Boolean]
[, changeStrokePattern as Boolean]
[, changeLineWidths as Double]
[, transformAbout as AiTransformation
Translate
([deltaX as Double]
[, deltaY as Double]
[, transformObjects as Boolean]
[, transformFillPatterns as Boolean]
[, transformFillGradients as Boolean]
[, transformStrokePatterns as Boolean])
ZOrder
(zOrderCmd as AiZOrderMethod
)
])
])
NothingRotates the art item relative to the
current rotation. The object is
rotated counter-clockwise if the
Angle value is positive, clockwise
if the value is negative.
NothingTransforms the art item by
applying a transformation matrix.
NothingRepositions the art item relative to
the current position, where
deltaX is the horizontal offset and
deltaY is the vertical offset.
NothingArranges the art item’s position in
the stacking order of the group or
layer (
Parent) of this object.
Creating a group
It is easy to modify all of the objects contained in a group. This example demonstrates how to simplify your
operations on multiple objects by creating a group to contain them.
'Creates a new group in the current document, containing
'a path item, and a text item
Set appRef = CreateObject("Illustrator.Application")
'Create a new group in the active document.
'This will be the group that holds the new triangle art
Set triangleGroup = appRef.ActiveDocument.GroupItems.Add
'Create a triangle and add text inside the group
Set trianglePath = triangleGroup.PathItems.Add
trianglePath.SetEntirePath Array(Array(100, 100), Array(300, 100), Array(200,
Tan(1.0471975) * 100 + 100))
Set captionText = triangleGroup.TextFrames.Add
captionText.Position = Array(100, 100)
captionText.Contents = "A triangle"
CHAPTER 1: VBScript Object ReferenceGroupItems 90
GroupItems
A collection of GroupItem objects.
GroupItems properties
PropertyValue typeWhat it is
ApplicationApplication
CountLong
ParentDocument
GroupItems methods
MethodReturnsWhat it does
Add
()
CreateFromFile
(imagefile as String)
Index
(item as GroupItem)
Item
(itemkey)
RemoveAll
()
GroupItem
GroupItem
Long
GroupItem
Nothing
Read-only. The Illustrator Application object.
Read-only. The number of objects in the collection.
Read-only. The document that contains this object.
Creates a new object.
Creates a GroupItem from a vector graphics file.
Returns the index position of the object within the
collection.
Returns an object reference to the object identified by
itemkey (name or index).
Deletes all objects in this collection.
Importing a file using GroupItems
The following script shows how you can import a JPEG document using the CreateFromFile function.
Before running this script you have to create a one-page PDF file and put it in the location.
C:\temp\AiExport.jpg.
'Adds a new group item to the document from a file (dest)
'dest contains the full path and file name of the file
Sub embedPDF (dest)
Set appRef = CreateObject("Illustrator.Application")
Set importedGroup = appRef.ActiveDocument.GroupItems.CreateFromFile (dest)
End Sub
Options that can be supplied when saving a document as an Illustrator file with the document SaveAs
method.
IllustratorSaveOptions properties
PropertyValue typeWhat it is
ApplicationApplication
ArtboardRangestring
CompatibilityAiCompatibility
CompressedBoolean
EmbedICCProfileBoolean
EmbedLinkedFilesBoolean
FlattenOutputAiOutputFlattening
FontSubsetThresholdDouble
Read-only. The Illustrator Application object.
If SaveMultipleArtboards is true (which is valid
only for Illustrator 13 or earlier), the document is
considered for multi-asset extraction, which
specifies an artboard range. An empty string
extracts all artboards. Default: empty string
Version of the Illustrator file format to create.
Default:
15 ’ aiIllustrator15
(Illustrator version 10 or later) If true, the saved file
is compressed. Default:
true
If true, an ICC profile is embedded in the saved file.
If true, linked image files are included in the saved
document (only valid for
SaveOptions that specify
an Illustrator compatibility of version 7 or later).
Specifies how transparency is flattened for file
formats older than Illustrator 9.
Include a subset of fonts when less than this
percentage of characters is used in the document
(valid for Illustrator 9 or newer file format).
PDFCompatibleBoolean
SaveMultipleArtboardsboolean
If true, save as a PDF compatible file (version 10 or
later). Default:
true
If true, all artboards or range of the artboards are
saved. Valid for Illustrator 13 or earlier.
This example illustrates how to save the frontmost document as Illustrator 8 format. Because the
document is saved as a version earlier than 9, the example specifies how to convert opacity by breaking
paths up in to sub-paths to preserve the appearance of the illustration.
'Saves current document in Illustrator format to dest with certain options
'specified in the script, dest contains the full path and file name to save to
Sub exportfileToAi (dest)
Set appRef = CreateObject("Illustrator.Application")
Set saveOptions = CreateObject("Illustrator.IllustratorSaveOptions")
Options for image capture, used with the ImageCapture method. All properties are optional.
ImageCaptureOptions properties
PropertyValue typeWhat it is
AntiAliasingBoolean
ApplicationApplication
MatteBoolean
MatteColorRGBColor
ResolutionDouble
TransparencyBoolean
If true, the image result is anti-aliased. Default: false
Read-only. The Illustrator Application object.
If true, the artboard is matted with a color. Default: false
The color to use for the artboard matte. Default: white
The resolution of the captured image file in points-per-inch (PPI),
in the range 72.0 to 2400.0. Default:
If true, the image result is transparent. Default: false
150
CHAPTER 1: VBScript Object ReferenceInk 94
Ink
Provides information about the ink name and related information.
Ink properties
PropertyValue typeWhat it is
ApplicationApplication
InkInfoInkInfo
NameString
Read-only. The Illustrator Application object.
The ink information.
The ink’s name.
CHAPTER 1: VBScript Object ReferenceInkInfo 95
InkInfo
Specifies ink properties.
InkInfo properties
PropertyValue typeWhat it is
AngleDouble
ApplicationApplication
CustomColor
DensityDouble
DotShapeString
FrequencyDouble
KindAiInkType
PrintingStatusAiInkPrintStatus
TrappingAiTrappingType
TrappingOrderLong
ObjectThe color of the custom ink.
The ink’s screen angle in degrees. Range: -360 to 360
Read-only. The Illustrator Application object.
The neutral density. Minimum: 0.0
The dot shape name.
The ink’s frequency. Range: 0.0 to 1000.0
The ink type.
The ink printing status.
The trapping type.
The order of trapping for the ink. Range: 1 to 4 for CMYK
CHAPTER 1: VBScript Object ReferenceInkInfo 96
List inks in a document
'Gets the details of each ink in this document
'and displays them in a text frame
Set appRef = CreateObject("Illustrator.Application")
'create a new document and simple text frame
Set docRef = appRef.Documents.Add()
Set textRef = docRef.TextFrames.Add()
textRef.Top = docRef.Height - 100
textRef.Left = 100
'collect data from each Ink and InkInfo object
For Each inkRef In appRef.ActiveDocument.InkList
'Creates a new document, adds a text frame then
'uses insertion points to add a space between all characters
Set appRef = CreateObject("Illustrator.Application")
Read-only. The Illustrator Application object.
Read-only. Number of elements in the collection.
Read-only. The object’s container.
Long
InsertionPoint
Returns the index position of the object within the
collection.
Gets an element from the collection by itemKey
(name or index).
'create a new document and text frame
Set docRef = appRef.Documents.Add()
Set textRef = docRef.TextFrames.Add()
textRef.Contents = "Wouldn't you rather be scripting?"
textRef.Top = 400
textRef.Left = 100
textRef.TextRange.CharacterAttributes.Size = 20
appRef.Redraw
i = 2
Do While (i < textRef.InsertionPoints.Count)
textRef.InsertionPoints(i).Characters.Add (" ")
i = i + 2
Loop
CHAPTER 1: VBScript Object ReferenceLabColor 99
LabColor
A color specification in the CIE Lab color space, used where a color info object is required.
LabColor properties
PropertyValue typeWhat it is
ApplicationApplication
ADouble
BDouble
LDouble
Read-only. The Illustrator Application object.
The a (red-green) color value. Range -128.0–128.0. Default: 0.0
The b (yellow-blue) color value. Range -128.0–128.0. Default: 0.0
The l (lightness) color value. Range -128.0–128.0. Default: 0.0
CHAPTER 1: VBScript Object ReferenceLayer 100
Layer
A layer in an Illustrator document. Layers may contain nested layers, which are called sublayers in the user
interface.
Layer object contains all of the page items in the layer as elements. Your script can access PageItems as
elements of either the
layer can be accessed through the
the document.
Layer properties
PropertyValue typeWhat it is
Layer object or as elements of the Document object. Only those page items in that
Layer object. To see page items in different layers, access them through
ApplicationApplication
ArtworkKnockoutAiKnockoutState
BlendingModeAiBlendModes
ColorRGBColor
CompoundPathItemsCompoundPathItems
DimPlacedImagesBoolean
GraphItemsGraphItems
GroupItemsGroupItems
HasSelectedArtworkBoolean
IsIsolatedBoolean
LayersLayers
Read-only. The Illustrator Application object.
Is this Layer used to create a knockout, and if so,
what kind.
The mode used when compositing an object.
The Layer’s selection mark color.
Read-only. The CompoundPathItems contained in
this layer.
If true, placed images are rendered as dimmed in
this layer.
Read-only. The GraphItems collection contained in
this layer.
Read-only. The GroupItems contained in this layer.
If true, an object in this Layer has been selected;
setting this property to
false deselects all objects in
the layer.
If true, this Layer is isolated.
Read-only. The Layers contained in this layer.
LegacyTextItemsLegacyTextItems
LockedBoolean
MeshItemsMeshItems
NameString
NonNativeItemsNonNativeItems
OpacityDouble
PageItemsPageItems
Read-only. The legacy text items contained in this
layer.
If true, this layer is editable.
Read-only. The MeshItems contained in this layer.
The name of this layer.
The non-native art items in this layer.
The opacity of the layer. Range: 0.0 to 100.0
Read-only. The PageItems contained in this layer.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.