Macromedia Illustrator - CS6 User Guide

ADOBE® ILLUSTRATOR® CS6
ADOBE ILLUSTRATOR CS6
SCRIPTING REFERENCE:
VBSCRIPT
© 2012 Adobe Systems Incorporated. All rights reserved.
Adobe Illustrator CS6 Scripting Reference: VBScript
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.
Contents
1 VBScript Object Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Artboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Artboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
AutoCADFileOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Brush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Brushes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
CharacterAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
CharacterStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
CharacterStyles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
CMYKColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Color info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
CompoundPathItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
CompoundPathItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
DataSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
DataSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
DocumentPreset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
EPSSaveOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
ExportOptionsAutoCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
ExportOptionsFlash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
ExportOptionsGIF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
ExportOptionsJPEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
ExportOptionsPhotoshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
ExportOptionsPNG8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
ExportOptionsPNG24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
ExportOptionsSVG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
ExportOptionsTIFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
FreeHandFileOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
FXGSaveOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
GradientColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3
Contents 4
Gradients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
GradientStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
GradientStops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
GraphicStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
GraphicStyles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
GraphItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
GraphItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
GrayColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
GroupItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
GroupItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
IllustratorSaveOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
ImageCaptureOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Ink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
InkInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
InsertionPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
InsertionPoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
LabColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
LegacyTextItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
LegacyTextItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
MeshItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
MeshItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
NoColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
NonNativeItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
NonNativeItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
OpenOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
PageItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
PageItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Paper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
PaperInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
ParagraphAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
ParagraphStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
ParagraphStyles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
PathItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Contents 5
PathItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
PathPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
PathPoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
PatternColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
PDFFileOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
PDFSaveOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
PhotoshopFileOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
PlacedItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
PlacedItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
PluginItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
PluginItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
PPDFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
PPDFileInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
PrintColorManagementOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
PrintColorSeparationOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
PrintCoordinateOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
PrinterInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
PrintFlattenerOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
PrintFontOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
PrintJobOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
PrintOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
PrintPageMarksOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
PrintPaperOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
PrintPostScriptOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
RasterEffectOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
RasterItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
RasterItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
RasterizeOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
RGBColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
ScreenInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
ScreenSpotFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Spot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
SpotColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Contents 6
Spots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Stories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Story . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Swatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Swatches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
SwatchGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
SwatchGroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
SymbolItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
SymbolItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
TabStopInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
TextFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
TextFonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
TextFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
TextFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
TextPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
TextRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
TextRanges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
TracingObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
TracingOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
2 Enumerations Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
1

VBScript Object 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 Reference Application 8

Application

The Adobe Illustrator application object, which contains all other Illustrator objects.

Application properties

Property Value type What it is
ActionIsRunning Boolean
ActiveDocument Document
Application Application
BrowserAvailable Boolean
BuildNumber String
ColorSettingsList Variant
CoordinateSystem
DefaultColorSettings String
Documents Documents
FlattenerPresetsList Variant
FreeMemory Long
Locale String
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.
Name String
Path String
PDFPresetsList
PPDFileList
Preferences Preferences
PrinterList Variant
PrintPresetsList Variant
ScriptingVersion String
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 Reference Application 9
Property Value type What it is
Selection
StartupPresetsList Variant
TextFonts TextFonts
TracingPresetList
UserInteractionLevel AiUserInteractionL
Version String
Visible Boolean

Application methods

Method Returns What 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.
Nothing Copies the current
selection to the clipboard.
Nothing Cuts the current selection
to the clipboard.
CHAPTER 1: VBScript Object Reference Application 10
Method Returns What it does
DoJavaScript
(JavaScriptCode as String,
[, Arguments as Variant Array] [, ExecutionMode as AiJavaScriptExecutionMode
DoJavaScriptFile
(JavaScriptFile as File,
[, Arguments as Variant Array] [, ExecutionMode as AiJavaScriptExecutionMode
DoScript
(Action as String,
From as String [, dialogs as Boolean])
GetIdentityMatrix
()
String
Executes the specified JavaScript® code.
])
String
Executes the specified JavaScript file.
])
Nothing Plays an action from the
Actions palette.
OTE: Use DoScript only if
N
you intend to run your script from an application external to Illustrator, such as the Windows® Script Host. Calling
DoScript
when running a script from Illustrator’s File > Scripts menu may yield unexpected results.
Matrix
Returns an identity matrix.
GetPPDFileInfo
(Name as String)
GetPresetFileOfType
(PresetType as AiDocumentPresetType
GetPresetSettings
(Preset as String)
GetRotationMatrix
([Angle as Double])
PPDFileI nfo
Gets detailed file information for specified PPD file.
String
)
Returns the full path to the default document profile for the specified preset type.
Document Preset
Retrieves the tracing-option settings from the template with a given preset name.
Matrix
Returns a transformation matrix containing a single rotation.
OTE: Requires a value in
N
degrees. For example, 30 rotates the object 30 degrees counterclockwise;
-30 rotates the object 30 degrees clockwise.
CHAPTER 1: VBScript Object Reference Application 11
Method Returns What it does
GetScaleMatrix
([scaleX as Double]
[, scaleY as Double])
GetScriptableHelpGroup
()
GetTranslationMatrix
([deltaX as Double]
[, deltaY as Double])
Matrix
variant
Matrix
Returns a transformation matrix containing a single scale.
N
OTE: Requires a value in
percentage. For example, 60 scales the object to 60% of its original size; 200 doubles the object’s bounds.
Gets the scriptable help group object that represents the search widget in the app bar.
Returns a transformation matrix containing a single translation.
N
OTE: Requires a value in
points. For example, {100,200} moves the object 100 pt. to the right and 200 pt. up; a minus before each number moves the object left and down.
InvertMatrix
(matrix as Matrix)
IsEqualMatrix
(matrix as Matrix,
secondMatrix as Matrix)
IsSingularMatrix
(matrix as Matrix)
LoadColorSettings
(fileSpec as String)
Matrix
Boolean
Inverts a matrix.
Checks whether two matrices are equal.
Boolean
Checks whether a matrix is singular and cannot be inverted.
Nothing Loads color settings from
specified file, or, if file is empty, turns color management off.
CHAPTER 1: VBScript Object Reference Application 12
Method Returns What it does
Open
(file as String,
[documentColorSpace as AiDocumentColorSpace [options as Object])
Paste
()
Quit
Redo
()
Redraw
()
Document
Opens the specified file document.
],
If called to open a pre-Illustrator 9 document that contains both RGB and CMYK colors, supply
DocumentColorSpace in
order to convert all colors to the specified color space. If not supplied, Illustrator displays a dialog to the user.
Nothing Pastes the clipboard
content into the current document.
Nothing Quits Illustrator.
Nothing Redoes the most recently
undone transaction.
Nothing Forces Illustrator to redraw
all its windows.
ShowPresets
(fileSpec as String)
TranslatePlaceholderText
(text as String)
Undo
()
Nothing Gets the presets from the
file.
Nothing Translates the placeholder
text to regular text; a way to enter unicode points in hex values.
Nothing Undoes the most recent
transaction.
CHAPTER 1: VBScript Object Reference Application 13
Opening a document
' 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:
Set appRef = CreateObject("Illustrator.Application") appRef.DoScript "Opacity 60 (selection)", "Default Actions" WHILE(appRef.ActionIsRunning)
WScript.sleep 1000 WEND msgbox "Done"
Invoking JavaScript
DoJavaScript and DoJavaScriptFile can be used to invoke scripts written in JavaScript for Illustrator.
The first argument to example, the following script displays an alert using the JavaScript
appRef.DoJavaScript "alert( 'Number of open documents: ' + _documents.length);"
This example returns the number of open documents.
Set myNumberOfDocuments = appRef.DoJavaScript("documents.length;") MsgBox myNumberOfDocuments
DoJavaScript is a string that must evaluate to a valid JavaScript expression. For
alert method.
CHAPTER 1: VBScript Object Reference Application 14
Copy and paste between documents
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 Reference Artboard 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

Property Value type What it is
Application Application
ArtboardRect Rect
Name String
Parent Document
RulerOrigin Point
RulerPAR Double
ShowCenter Boolean
ShowCrossHairs Boolean
ShowSafeAreas Boolean

Artboard methods

Method Returns What 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
()
Nothing Deletes this artboard object. You cannot remove the last
artboard in a document.
CHAPTER 1: VBScript Object Reference Artboards 16

Artboards

A collection of artboards.

Artboards properties

Property Value type What it is
Application Application
Count Long
Parent Document

Artboards methods

Method Returns What 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.
Nothing Creates 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).
Nothing Deletes an artboard object. You cannot remove the last
artboard in a document.
Nothing Makes a specific artboard active and makes it current in
the iteration order.
CHAPTER 1: VBScript Object Reference AutoCADFileOptions 17

AutoCADFileOptions

Options for opening an AutoCAD drawing, used with the Open method.

AutoCADFileOptions properties

Property Value type What it is
Application Application
CenterArtwork Boolean
GlobalScaleOption AiAutoCADGlobalScaleOption
GlobalScalePercent Double
MergeLayers Boolean
Parent Document
ScaleLineweights Boolean
SelectedLayoutName String
Read-only. The Illustrator Application object.
If true, center the artwork that is created on the artboard. Default is
true.
How to scale the drawing on import. Default is
1 ' aiFitArtboard
The value when globalScaleOption is
2 ' aiScaleByValue, expressed as a
percentage. Range: 0.0 to 100.0 Default is
100.0
If true, the layers of the artwork are merged. Default:
false
Read-only. The document that contains this object.
If true, scales line weights by the same factor as the rest of the drawing. Default is
false.
Name of the layout in the drawing to import.
Unit AiAutoCADUnit
UnitScaleRatio Double
The unit to map to. Default is
3 ' aiMillimeters.
The ratio by which to scale while mapping units. Default is
1.0
CHAPTER 1: VBScript Object Reference Brush 18

Brush

A brush in an Illustrator document. Illustrator brushes can be accessed, but not created or deleted, from a script.

Brush properties

Property Value type What it is
Application Application
Name String
Parent Object

Brush methods

Method Returns What it does
ApplyTo
(artItem as PageItem)
Applying a Brush
'Creates a new group, adds a duplicate of each selected item to the group 'then applies a brush to each item in the group
Set appRef = CreateObject("Illustrator.Application")
If appRef.Documents.Count > 0 Then
If Not IsEmpty(appRef.Selection) Then
selectedItems = appRef.Selection startIndex = LBound(selectedItems) endIndex = UBound(selectedItems)
Read-only. The Illustrator Application object.
The Brush name.
Read-only. The container object.
Nothing Applies the brush to a specific art item.
End If End If
Set newGroup = appRef.ActiveDocument.GroupItems.Add For i = startIndex To endIndex
Set artItem = selectedItems(i) Set dupItem = artItem.Duplicate(newGroup, aiPlaceAtEnd) appRef.ActiveDocument.Brushes(2).ApplyTo artItem
Next
CHAPTER 1: VBScript Object Reference Brushes 19

Brushes

A collection of brushes in a document.

Brushes properties

Property Value type What it is
Application Application
Count Long
Parent Object

Brushes methods

Method Returns What it does
Index
(item as Brush)
Item
(itemKey)
Get all brushes in a document
'Counts the number of brushes in the current document 'and stores in numBrushes
Set appRef = CreateObject("Illustrator.Application")
Long
Brush
Read-only. The Illustrator Application object.
Read-only. Long. 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).
(
If appRef.Documents.Count > 0 Then
numBrushes = appRef.ActiveDocument.Brushes.Count End If
CHAPTER 1: VBScript Object Reference CharacterAttributes 20

CharacterAttributes

Specifies the properties of a character contained in a text frame. A CharacterStyle object associates attributes with a text range. See
OTE: Character attributes do not have default values and are undefined until explicitly set.
N

CharacterAttributes properties

Property Value Type What it is
CharacterStyle” on page 26.
AkiLeft Double
AkiRight Double
Alignment AiStyleRunAlignmentType
AlternateGlyphs AiAlternateGlyphsForm
Application Application
AutoLeading Boolean
BaselineDirection AiBaselineDirectionType
BaselinePosition AiFontBaselineOption
BaselineShift Double
The amount of inter-glyph space added to the left side of the glyph in Japanese text (in thousandths of an em).
The amount of inter-glyph spacing added to the right side of the glyph in Japanese text (in thousandths of an em).
The character alignment type.
Specifies which kind of alternate glyphs are used.
Read-only. The Illustrator
Application object.
If true, automatic leading is used.
The Japanese text baseline direction.
The baseline position of text.
The amount of shift (in points) of the text baseline.
Capitalization AiFontCapsOption
ConnectionForms Boolean
ContextualLigature Boolean
DiscretionaryLigature Boolean
FigureStyle AiFigureStyleType
Specifies whether the text is normal, all uppercase, all small caps, or a mix of small caps and lowercase.
If true, OpenType® connection forms are used.
If true, contextual ligatures are used.
If true, discretionary ligatures are used.
The number style in an OpenType font.
CHAPTER 1: VBScript Object Reference CharacterAttributes 21
Property Value Type What it is
FillColor
Fractions Boolean
HorizontalScale Double
Italics Boolean
KerningMethod AiAutoKernType
Language AiLanguageType
Leading Double
Ligature Boolean
NoBreak Boolean
OpenTypePosition AiFontOpenTypePositionOption
Ordinals Boolean
Ornaments Boolean
Object The color of the text fill.
If true, OpenType fractions are used.
The horizontal scaling factor (as a percentage).
If true, the Japanese font supports italics.
The kerning method.
The language of the text.
The amount of space between two lines of text, in points.
If true, ligatures are used.
If true, no break is allowed.
The OpenType baseline position.
If true, OpenType ordinals are used.
If true, OpenType ornaments are used.
OverprintFill Boolean
OverprintStroke Boolean
Parent
ProportionalMetrics Boolean
Rotation Double
Size Double
StrikeThrough Boolean
StrokeColor
StrokeWeight Double
StylisticAlternates Boolean
Swash Boolean
Object Read-only. The object’s container.
Object The color of the text stroke.
If true, overprint the fill of the text.
If true, overprinting of the stroke of the text is allowed.
If true, proportional metrics in Japanese OpenType are used.
The character rotation angle.
The font size in points.
If true, characters are struck-through by a line.
Line width of stroke.
If true, OpenType stylistic alternates are used.
If true, OpenType swash characters are used.
CHAPTER 1: VBScript Object Reference CharacterAttributes 22
Property Value Type What it is
TateChuYokoHorizontal Long
TateChuYokoVertical Long
TextFont TextFont
Titling Boolean
Tracking Long
Tsume Double
Underline Boolean
VerticalScale Double
WariChuCharactersAfter Break
Long
The Tate-Chu-Yoko horizontal adjustment in points.
The Tate-Chu-Yoko vertical adjustment in points.
The font used for the character.
If true, OpenType titling alternates are used.
The tracking or range kerning amount in thousandths of an em.
The percentage of space reduction around a Japanese character.
If true, characters are underlined.
Character vertical scaling factor.
Specifies how the characters in Wari-Chu text (an inset note in Japanese text) are divided into two or more lines.
WariChuCharactersBeforeBr eak
WariChuEnabled Boolean
WariChuJustification AiWariChuJustificationType
WariChuLineGap Long
WariChuLines Long
WariChuScale Double
Long
Specifies how the characters in Wari-Chu text (an inset note in Japanese text) are divided into two or more lines.
If true, Wari-Chu is enabled.
The Wari-Chu justification.
The Wari-Chu line gap.
The number of Wari-Chu (multiple text lines fit into a space meant for one) lines.
The Wari-Chu scale.
CHAPTER 1: VBScript Object Reference CharacterAttributes 23
Setting character attributes
'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))
dSize = dSize * 1.1
textRef.TextRange.Characters(i).CharacterAttributes.HorizontalScale = dSize
textRef.TextRange.Characters(i).CharacterAttributes.VerticalScale = dSize
i = i + 1 Loop
CHAPTER 1: VBScript Object Reference Characters 24

Characters

A collection of TextRange objects in which each represents a single character.

Characters properties

Property Value type What it is
Application Application
Count Long
Parent
Object Read-only. The object’s container.

Characters methods

Method Returns What 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.
Nothing Deletes every element in
the collection.
CHAPTER 1: VBScript Object Reference Characters 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
Next End If
CHAPTER 1: VBScript Object Reference CharacterStyle 26

CharacterStyle

A named style that specifies character attributes. For an example, see CharacterStyles.

CharacterStyle properties

Property Value type What it is
Application Application
CharacterAttributes CharacterAttributes
Name String
Parent
Object Read-only. The object’s container.

CharacterStyle methods

Method Returns What it does
ApplyTo
(textItem as Object [, clearingOverrides as Boolean])
Delete
()
Read-only. Application to which the collection belongs.
Read-only. The character properties for the style.
The character style’s name.
Nothing Applies the character style to the text object or
objects.
Nothing Deletes the object.
CHAPTER 1: VBScript Object Reference CharacterStyles 27

CharacterStyles

A collection of character styles.

CharacterStyles properties

Property Value type What it is
Application Application
Count Long
Parent
Object Read-only. The object’s container.

CharacterStyles methods

Method Returns What it does
Add
(Name as String)
Index
(itemPtr as CharacterStyle)
Item
(itemKey)
RemoveAll
()
Read-only. Application to which the collection belongs.
Read-only. Number of elements in the collection.
CharacterStyle
Long
Creates a named character style.
Returns the index position of the object within the collection.
CharacterStyle
Returns an object reference to the object identified by
itemKey (name or index).
Nothing Deletes all objects in this collection.
CHAPTER 1: VBScript Object Reference CharacterStyles 28
Create and apply character styles
'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 Reference CMYKColor 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

Property Value type What it is
Application Application
Black Double
Cyan Double
Magenta Double
Yellow Double
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)
'Set color values for the CMYK objects
newCMYKColor.Black = 0 newCMYKColor.Cyan = 30.4 newCMYKColor.Magenta = 32 newCMYKColor.Yellow = 0
frontPath.Filled = True frontPath.fillColor = newCMYKColor
CHAPTER 1: VBScript Object Reference Color info 30

Color info

An abstract parent class for all color classes used in Illustrator. Subclasses are:
CMYKColor GradientColor GrayColor LabColor NoColor PatternColor RGBColor SpotColor
Loading...
+ 238 hidden pages