Vbscript - Adobe 26001360 - Illustrator CS - PC Manual

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

Adobe Illustrator CS Scripting Guide
8. Run the script. Illustrator will create a new document, add a text frame item at the
specified position, and set the text to "Hello World!".

VBScript

You don't need to use Visual Basic to run scripts on Windows. Another way to script Illustrator is
to use a VBA editor (such as the one that is included in Microsoft Word) or to use Windows
Scripting Host.
Windows Scripting Host is part of Windows2000. If you don't have Windows2000, you can
download Windows Scripting Host from :
Both VBA and Windows Scripting Host use VBScript as their scripting language. The syntax for
VBScript is very similar to the Visual Basic syntax. The three main differences relating to the
scripts shown in this guide are:
• VBScript is not as strongly typed as Visual basic. In Visual Basic you say:
Dim aRef as Illustrator.PathItem
in VBScript you say:
Dim aRef
For VBScript simply omit the "as X" part.
• VBScript does not support the "as New Illustrator.Application" form.
In Visual Basic you retrieve the Application object as:
Dim appRef as New Illustrator.Application
In VBScript you write the following to retrieve the Application object:
Dim appRef
Set appRef = CreateObject("Illustrator.Application")
• VBScript does not support enumerations. Here's an example of how to close the
frontmost document without saving. In Visual Basic:
Dim appRef As New Illustrator.Application
appRef.ActiveDocument.Close (aiDoNotSaveChanges)
http://msdn.microsoft.com/scripting/
12 Aug 03
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents