Adobe 26001360 Scripting Guide - Page 39
VBScript, In VBScript you write the following to retrieve the Application object - download
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 39 highlights
Adobe Illustrator CS Scripting Guide 39 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 : http://msdn.microsoft.com/scripting/ 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) 12 Aug 03