Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Creative Suite Developer Center /

Developing multiple Creative Suite extensions

by Lea Savage

Lea Savage

Content

  • Getting Started
  • Creating a Multiple Extension Bundle
  • Where to go from here

Created

23 May 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
CS Extension Builder 1.5 extensibility Extension Manager Flash Builder

Requirements

Prerequisite knowledge

Experience with developing Creative Suite extensions and working within Creative Suite Extension Builder 1.5.

Required Adobe products (retail)

  • At least one Creative Suite 5 (or later) product

User level

All

Required products

  • Flash Builder (Download trial)
  • CS Extension Builder 1.5 (Download trial)
  • Extension Manager

When developing extensions for the Creative Suite there may be times when one panel cannot provide all the functionality that you would like to deliver. When this has occurred you may have developed a number of extensions and informed the user to install each individually or created additional windows within your panel to accommodate the different features. An alternative is to deliver a bundle that contains more than one extension. This tutorial will guide you through the steps of creating a Creative Suite extension bundle that contains a suite of extensions that can be installed by the user in one go.

Getting Started

In CS Extension Builder, create a new Project by choosing File > New > Adobe Creative Suite Extension Builder > Creative Suite Extension Project. Call the project MainExtension. Click Next. In the Configure Target Host Applications section select the product and version of the CS you want to target. For this tutorial we will use Adobe Illustrator CS5.5.

Figure 1. Target host configuration
Figure 1. Target host configuration

Click Finish. We now have our first extension project. We will use this as our main extension project.

MainExtension

The focus of this tutorial is to deliver multiple extensions in one bundle. Therefore we are not going to focus too much time with the content of the extensions. Edit the Actionscript class MainExtensionIllustrator.as and within the run function, add the following snippet of code:

var app:Application = Illustrator.app; // create a new document var document:Document = app.documents.add(); var text:TextFrame = document.textFrames.add(); text.contents = "Hello World!"; // text scale var textArtRange:TextRange = text.textRange; var characterCount:int = textArtRange.characters.length; for (var j:int = 0; j < characterCount; j++) { var textCharacter:TextRange = textArtRange.characters.index(j); textCharacter.characterAttributes.size = 28; } text.selected = true;

Now run the extension by selecting the project in the Package Explorer and choose Run > Run As > Adobe Illustrator Extension. In Adobe Illustrator when you click the Run AI code button you should see the following:

Figure 2. MainExtension running within Illustrator CS5.5
Figure 2. MainExtension running within Illustrator CS5.5

AdditionalExtension

The next step is to create another extension which can be included in our extension bundle.

  1. Create a new Creative Suite Extension Project.
  2. Call this extension AdditionalExtension.
  3. During the Configure Target Host Applications section use the same settings as the MainExtension project.
  4. Click Finish.

This additional extension will work with the TextFrame that we have created in MainExtension . Add the following code to the run function of AdditionalExtensionIllustrator .

AdditionalExtensionIllustrator. var app:Application = Illustrator.app; // get the current selection var selection:Object = app.selection; if (selection is Array) selection = selection[0]; if (selection is TextRange || selection is TextFrame) { var textArtRange:TextRange = selection.textRange; // retrieve the number of characters selected var characterCount:int = textArtRange.characters.length; for (var j:int = 0; j < characterCount; j++) { var textCharacter:TextRange = textArtRange.characters.index(j); if ((j & 1) == 0) { // if the character number is odd, enlarge the font size. textCharacter.characterAttributes.size = 48; } } }
Figure 3. AdditionalExtension running within Illustrator CS5.5
Figure 3. AdditionalExtension running within Illustrator CS5.5

Creating a Multiple Extension Bundle

We currently have two extensions that work with Text Frames in Adobe Illustrator. We have tested the functionality and at the moment their behaviour is separate. However when running the additional extension we require that a Text Frame is already created and selected in the active Document. As the main extension creates a Text Frame as part of its run method it would be beneficial if we could trigger the loading of the additional extension once the run function is complete. With this additional step it then seems logical to combine the extensions so they can be delivered as an extension bundle.

Invoking an Extension

Edit the AdditionalExtension.mxml file and add a creationComplete event listener:

<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml creationComplete="init()"> In the script section add the init() event handler: private function init():void { CSXSInterface.getInstance().addEventListener( com.adobe.csxs.events.InvokeEvent.INVOKE, extensionInvoked);

Within the init function we have added a CSXS event listener for InvokeEvent. This event will be dispatched when another flash panel attempts to start this extension. Add the extensionInvoked function so that it will bypass the button click and call the run function in AdditionalExtensionIllustrator.as

AdditionalExtensionIllustrator.as private function extensionInvoked( event:com.adobe.csxs.events.InvokeEvent):void { AdditionalExtensionIllustrator.run(); }

We now need to trigger the loading of the additional extension. Edit MainExtensionIllustrator.as and add the following snippet to the end of the run function:

CSXSInterface.getInstance().requestOpenExtension("com.example.additionalextension.extension1");

To find out the Extension ID, with your Creative Suite Extension project selected, right-click and choose CS Extension Builder > Bundle Manifest Editor. Select the Extension tab and as we only have one extension in our project, you will see the Extension ID listed in the General Information section.

Figure 4. Extension view within the Bundle Manifest Editor
Figure 4. Extension view within the Bundle Manifest Editor

Run the AdditionalExtension project and then use Attach As to include the updated version of the MainExtension project. When you click Run AI code, the Text Frame will be created and the additional extension loaded.

Figure 5. Both extensions running within Illustrator CS5.5
Figure 5. Both extensions running within Illustrator CS5.5

Adding an additional bundle

The previous step combined the two extensions into a workflow that created and then modified a Text Frame within Adobe Illustrator. Now we will modify the MainExtension project so it includes the AdditionalExtension project.

  1. Open the Bundle Manifest Editor for the MainExtension project and navigate to the Extensions tab.
  2. In the configuration section, click Add…
  3. If you expand the drop down you will see that we now have two extensions:
Figure 6. Two extensions listed in the bundle manifest editor
Figure 6. Two extensions listed in the bundle manifest editor
  1. With extension2 selected go to the different sections (General Information, Resources, Lifecycle, User Interface) and update the information.
  2. Include a Menu Name for the panel.
  3. Under Resources, in the SWF Path section select Project from the drop down.
  4. Select the AdditionalExtension project and the corresponding main MXML file.
Figure 7. Including the AdditionalExtension as a resource
Figure 7. Including the AdditionalExtension as a resource
  1. Save and close the Bundle Manifest Editor.
  2. Edit the MainExtensionIllustrator.as file and modify the name of the Extension ID so it reflects the newly added extension2 above:

CSXSInterface.getInstance().requestOpenExtension("com.example.mainextension.extension2");

When you now run the MainExtension project in Adobe Illustrator both panels will be updated. If you run the extension using Attach mode, both extensions will be loaded in the point product.

Exporting a multiple extension bundle

In the last section we combined our two Creative Suite extension projects into a multiple extension bundle. The next step is to export the extension bundle.

Please note that the previous sections should have been adequate steps to combine the multiple extensions bundle so that they are ready for exporting. However with the current release of CS Extension Builder 1.5 there is a known issue that prevents the .swf from the additional project being included in the exported bundle. To rectify this issue, open the Bundle Manifest Editor for the MainExtension and within the Extension tab select to modify extension2. In the Resources section change the SWF Path from Project to Path. Change the path to point to the AdditionalExtension.swf which is located in the MainExtension debug folder.

Figure 8. Using swf path workaround in Bundle Manifest Editor
Figure 8. Using swf path workaround in Bundle Manifest Editor
  1. Save and close the Bundle Manifest Editor.
  2. With the MainExtension project selected choose File > Export > Adobe Creative Suite Extension Builder > Creative Suite Extension.
  3. Enter the required fields.
  4. Click Finish.

You can now install the generated .zxp using Adobe Extension Manager CS5.5. Once installed in Extension Manager you will only have one extension listed. Open Adobe Illustrator and you will see both extensions listed in the Window > Extensions menu.

fig09

Where to go from here

  • Extension Builder Forum
  • CS SDK Forum

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

More Like This

  • Adobe Creative Suite image conversion utility
  • So you want to sell your Creative Suite extensions?
  • Handling XMP Metadata with Creative Suite Extension Builder
  • Skinning Creative Suite extensions
  • Debugging Workflows in Creative Suite Extension Builder
  • Overview of Adobe Creative Suite Extensibility
  • Introducing CS Extension Builder 1.5
  • Developing extensions for multiple versions of the Creative Suite
  • Developing hybrid extensions with Creative Suite Extension Builder

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement