The basic process of connecting with Illustrator and creating objects in a page layout is shown in the "HelloIllustrator" sample, available through the Extension Builder Remote Example Importer; see Importing and running the samples in the Getting Started Guide. This guide provides an overview of the Illustrator document object model (DOM), an introduction to the techniques you use to manipulate Illustrator documents, and a set of examples that illustrate particular tasks.
Illustrator Scripting Object Model: A good understanding of the Illustrator object model will improve your scripting abilities. This section provides an overview of the class hierarchy and organization.
Scripting Illustrator: This section provides advice and examples for performing specific programming tasks.
The menu items for extensions that you create with Adobe Creative Suite Extension Builder can only be shown in the menu Window > Extensions. If you want to start your extension from another menu, you can do so using an Illustrator C++ plug-in. Your C++ menu plug-in must launch your Flash-based extension using the C++ PlugPlug API. To prevent your extension from being displayed in the Window > Extensions menu, remove the menu name from the extension manifest.
For information on how to create a custom menu placement plug-in and how the plug-in can talk to your extension see the Illustrator SDK (http://www.adobe.com/devnet/illustrator/sdk/). The FreeGrid sample demonstrates how to load your extension from C++, and the MenuPlay sample demonstrates how to add a custom menu to Illustrator.
Once you have created both the C++ plug-in and Flash-based components of your extension, bundle them together for distribution as a hybrid extension. For details, see the Signing and Packaging Toolkit, which you can download from the Adobe Creative Suite SDK page, http://www.adobe.com/devnet/creativesuite/.
You can register for events using the AIHostAdapter library and C++ plug-in. These components are available as part of the Adobe Creative Suite Extension Builder. See Host Adapter Libraries for information on how to set up your Adobe Creative Suite extension to use this technology.
Illustrator supports these CSXS events:
|
Event |
Description |
|
documentAfterActivate |
Triggered when a document has been activated. |
|
documentAfterDeactivate |
Triggered when the active document has been deactivated. |
|
applicationActivate |
Triggered when the application gets an "activation" event from the operating system. |
See Event Handling in Extensions for information on how to work with events
Illustrator-specific events exposed in the C++ API (such as kAIArtSelectionChangedNotifier) are not yet supported in ActionScript; you can, however, create a C++ plug-in that listens for these events, and propagates them to ActionScript using custom CSXS Event objects. The FreeGrid sample in the Illustrator SDK also illustrates this technique.