In case you don’t know, a hybrid extension is an extension which consists of one or more native plug-ins and one or more HTML (or Flash) extensions.

The new APIs, found in the SDK at /source/public/interfaces/ui/ICSXSPlugPlugExtensions.h, enable workflows where a native plug-in needs to open or close an extension.

Whilst there is no need to port or recompile your plug-ins from 10.0 to be compatible with 10.1, if you want to use this API you will need to use the latest SDK to pick up the new header and you will then have to recompile.

The two APIs are LoadExtension and UnloadExtension, each taking the bundle ID of the extension you wish to open or close.

Here’s a quick example to get you going:

#include "ICSXSPlugPlugExtensions.h"
InterfacePtr plugPlug(GetExecutionContextSession(), UseDefaultIID());
// open an extension
plugPlug->LoadExtension(PMString("com.mycompany.myextension"));
// close an open extension
plugPlug->UnloadExtension(PMString("com.mycompany.myextension"));

Enjoy!

]]>http://blogs.adobe.com/indesignsdk/new-plugplug-apis-for-hybrid-extension-developers/feed/0InDesign CC 2014 SDKhttp://blogs.adobe.com/indesignsdk/indesign-cc-2014-sdk/
http://blogs.adobe.com/indesignsdk/indesign-cc-2014-sdk/#commentsThu, 19 Jun 2014 10:15:30 +0000http://blogs.adobe.com/indesignsdk/?p=301Continue reading →]]>The InDesign CC 2014 SDK will be available on the InDesign Family SDK Access Program from June 20.

If you are new to InDesign development, the best place to get started is ‘Getting Started with InDesign Development’, which is a guide included in the SDK.

As for this latest release, the following are the most significant changes in the SDK.

Xcode updated to Xcode 5.0.2.

Visual Studio updated to Visual Studio 2012 SP4.

PMString::GrabCString removed.

Windows HiDPI support added.

Boost version updated to 1.54.

IPMStream updated to support files larger than 4GB.

CSXS events with global scope are replaced with VulcanMessage.

The porting guide, included in the SDK, contains more in-depth information on each of these changes, but I’ve given summaries below.

For Mac development, Mac OS 10.8.4 or later is now required (Xcode 5.0.2 requires this).

IDE Requirements

Visual Studio version is now Visual Studio 2012 SP4

To update a Visual Studio project, the simplest method is to open the project in Visual Studio 2012 and use the prompt to update the project.

Alternatively you can modify the project file in a text editor by changing the PlatformToolset version to v110. Details are given in the porting guide.

Xcode version is now Xcode 5.0.2

Updating Xcode projects

When building your projects with Xcode 5, one issue you will quickly run into is PluginPList.plc giving compilation issues:

Unable to run command 'CopyPlistFile Info.plist' this target might include its own product.

In case you don’t know, PluginPList.plc is the template for generating plugin plist files.

To fix this, move the plc file from the Sources group section into the Resources group in the Xcode project. You can do this in the Xcode IDE by dragging PluginPList.plc from Sources to Resources. The effect of this change is that the .plc file is included in the “Copy Bundle Resources Phase” instead of the “Compile Sources Phase”.

Boost version change

InDesign now uses Boost 1.54, with some modifications. One side effect of this change is that you may need to update your plug-in projects to link against boost_system.

Removal of GrabCString from PMString

PMString::GrabCString has been removed. You should use GetCString or GetPlatformString().c_str() instead.

Windows HiDPI support

InDesign now supports HiDPI on Windows. If you added support for HiDPI on Mac in the 9.0 release of InDesign, you will now need to make similar changes for Windows.

If you use widgets with custom drawing, you should test how they look on Windows at 2x and 1.5x to see if changes are required. In most cases, the drawing that you are doing for 1x should work on 1.5x and 2x. You might sometimes need to do some one pixel adjustments specific to 1.5x or 2x. Standard widgets work fine without any changes.

InDesign supports the following scaling factors:

System Scaling < 1.24 => InDesign Scaling = 1x

System Scaling >= 1.25 and <= 1.74 => InDesign Scaling = 1.5x

System Scaling >= 1.75 => InDesign Scaling = 2x

CSXS events with global scope are no longer supported

In InDesign 9.0 we added an API for dispatching CSXS events. This API included the ability to dispatch events with global scope so they could be sent between applications.

In InDesign 10.0, CSXS events with global scope are no longer supported and Vulcan Messages should be used instead. A new API has been added to send/receive VulcanMessages. The API exists at: /source/public/interfaces/ui/ICSXSVulcanMessageHandler.h.

As you may already know, starting in the middle of 2014 Adobe will begin removing Flash-based extension support in Creative Cloud products, starting with Photoshop CC.

If you have any hybrid or regular Flash extensions for InDesign you need to begin migrating them to HTML5 as soon as possible.

I just create plug-ins, why should I care?

HTML5 extensions are a great opportunity to create compelling user-interfaces for native plug-ins. But that’s not all. Creating hybrid extensions (where you have a native plug-in and a UI extension) also forces you to properly separate model and UI in your overall architecture.

I’m not saying you should slap an HTML UI on every-one of your plug-ins. For example, if your plug-in only has dialogs I wouldn’t bother. But if the plug-in had its own panel, then I would certainly consider using HTML.

Where do I start?

Adobe Extension Builder has been updated for HTML5 development. If you are not a fan of eclipse, just create your project in Extension Builder then use a text editor from that point on.

There are two methods for enabling two-way communication between an HTML extension and a native plug-in:

You can add a scripting interface to your plug-in with some methods and properties, and have the HTML/JS extension use evalScript calls to run ExtendScript which calls these methods/properties.

You can send CSXS events back and forth between the native plug-in and HTML/JS extension.

The easiest method is the latter: using CSXS events. The attached sample, which includes an HTML extension and native plug-in, uses this method. It does also demonstrate how to add a scripting interface to a plug-in, should you wish to go down that route. If you wanted to call this scripting API from an HTML extension, you would need to use the evalScript function provided by CSInterface. For example:

The sample attached to this post has the following message handler, which nicely demonstrates how to handle a received message, do something with its data (in this case, show it in an alert dialog), and send a message back. Here is the code:

]]>http://blogs.adobe.com/indesignsdk/html-extensions-in-indesign/feed/1Changing UI preferences in Javascripthttp://blogs.adobe.com/indesignsdk/changing-ui-preferences-in-javascript/
http://blogs.adobe.com/indesignsdk/changing-ui-preferences-in-javascript/#commentsTue, 13 Aug 2013 13:26:35 +0000http://blogs.adobe.com/indesignsdk/?p=191Continue reading →]]>A new feature in InDesign CC is the Dark UI. You can now adjust UI brightness and other UI properties using scripting.

matchPreviewBackgroundToThemeColor: If set to true the Preview Background color will be set to match the Theme Color

pasteboardColorPreference: Lets you set Pasteboard Color preference. Use 0 to set pasteboard color preference to Default White, and 1 to set preference to Match with Theme Color.

uiBrightnessPreference: Lets you specify the Application User Interface brightness preference (from 0.0 to 1.0). To use color theme brightness preset values, specify 0.0 for Dark, 0.33 for Medium Dark, 0.67 for Medium Bright, and 1.0 for Bright. Any value between 0.0 and 1.0 can also be used.

]]>http://blogs.adobe.com/indesignsdk/changing-ui-preferences-in-javascript/feed/0Creating QR Codes in JavaScripthttp://blogs.adobe.com/indesignsdk/creating-qr-codes-in-javascript/
http://blogs.adobe.com/indesignsdk/creating-qr-codes-in-javascript/#commentsThu, 08 Aug 2013 10:18:35 +0000http://blogs.adobe.com/indesignsdk/?p=188Continue reading →]]>A new feature in InDesign CC is the ability to create and place QR codes. Here, I show how to do this using JavaScript.

If a mobile app was used to scan this QR code it would take the user straight to www.adobe.com (although app behaviour does differ).

For more examples, see AddQRCodes.jsx in the Scripting SDK.

]]>http://blogs.adobe.com/indesignsdk/creating-qr-codes-in-javascript/feed/2What’s new in the InDesign CC SDKhttp://blogs.adobe.com/indesignsdk/whats-new-in-the-indesign-cc-sdk/
http://blogs.adobe.com/indesignsdk/whats-new-in-the-indesign-cc-sdk/#commentsThu, 08 Aug 2013 09:37:21 +0000http://blogs.adobe.com/indesignsdk/?p=182Continue reading →]]>As you may have noticed, the InDesign CC SDK is available by request from http://www.adobe.com/devnet/indesign.html.

In this latest release we’ve added new samples to the SDK whilst some more basic features of plug-in development have also changed. We’ll talk about the new samples in future blog posts, but find below the more fundamental changes you need to know about if you are creating plug-ins for InDesign CC.

HiDPI support

Since InDesign CC supports the retina display of the MacBook Pro, plug-in developers now need to provide additional icons and cursors for their plug-ins.

To support HiDPI on Mac OS, plug-ins with icons should provide alternative versions of icons. The icons do not need to be HiDPI, but they should be double the dimensions of the original icons. For example, if the original icon is 22×22 then the HiDPI icon should be 44×44.

All of this is demonstrated in the project called SnapShot.sdk.xcodeproj included in the SDK. This sample also shows how to use a separate FR file for icon and cursor definitions, which is encouraged and especially useful for plug-ins with a large number of icon and cursor definitions.

Cursors and icons

PNGs instead of rsrc

Plug-ins must now use PNGs for icons and cursors and provide light and dark versions. We made this change since the Mac platform has deprecated the use of rsrc files, which used to be the primary source for cursors. Using PNGs provides a cross-platform method of cursor management.

Light and dark icons

To support theming, in which the application skin can be made light or dark, plug- ins with icons should now provide two icons, one light and one dark.

EVE dialogs

EVE (Adobe Express View Engine) has been recommended for defining dialog layout in previous releases but in CC we converted all of InDesign’s dialogs to use EVE. It is still possible to not use EVE, but we would strongly recommend that you use it for dialogs.

Using EVE gives the following benefits:

In cases where text is different sizes on different operating systems, you no longer have to worry about calculating extra whitespace.

English dialogs can be smaller because you do not need to leave room for anticipated localized text being longer.

EVE eliminates problems with widgets that don’t quite line up correctly or text being chopped off because EVE automatically resizes static text, buttons, check boxes, radio buttons, and drop-down lists.

All SDK samples with dialogs have been updated to use EVE and there is a new PDF inside the plug-in SDK (Using EVE for Dialogs) documenting how to use it, and also how to convert existing dialogs to use EVE using a tool included in the SDK to get you started.

64bit Mac

InDesign CC is 64bit only on Mac OS. A large chunk of work for us in this release of InDesign was to decarbonize InDesign, that is to say, remove the use of Carbon APIs and make InDesign a Cocoa based application.

All SDK samples have 64bit Mac OS support and the plug-in project generator ‘dolly’ can be used for creating new plug-in projects with 64bit Mac support.

System requirements

The operating system requirements for InDesign are Windows 7 or later for Windows, and Mac OS 10.6 or later for Mac OS. Unlike the CS6 plug-in SDK, it is not possible to use Windows XP for developing InDesign plug-ins. This is due to InDesign CC being dependent on APIs found only in Windows 7 or later.

Regarding IDEs, as in CS6, we require Visual Studio 2010 on Windows. Unlike CS6, on Mac OS we require Xcode 4.5.2 rather than Xcode 3.2.5.

]]>http://blogs.adobe.com/indesignsdk/whats-new-in-the-indesign-cc-sdk/feed/3Creating new plug-ins with the Dolly command line toolhttp://blogs.adobe.com/indesignsdk/dollyxs-command-line-tool/
http://blogs.adobe.com/indesignsdk/dollyxs-command-line-tool/#commentsMon, 25 Feb 2013 11:56:07 +0000http://blogs.adobe.com/indesignsdk/?p=148Continue reading →]]>Dolly is a Java application for generating new InDesign plug-in projects. It is included with the Plug-in SDK.

Dolly has a simple user interface, but it can also be used from the command line. The user interface version of Dolly has a limited number of settings that you can adjust, so using the command line has its advantages.

Using command line tool opens up a bigger range of options via manipulating the XML document directly. You can create many different input files and use them as templates for your plug-in development. In this blog post, I’ll show you how to use the command line to generate new InDesign plug-in projects.

Running Dolly

First, we’ll launch Dolly from the command line. Dolly is located inside the plug-in SDK: /devtools/sdktools/dollyxs.
We’ll need to open command prompt or terminal and set the current directory to /devtools/sdktools/dollyxs. Let’s first try running Dolly with user interface option turned on.

Windows:

DollyXs.bat win-input.xml

Mac:

DollyXs.sh mac-input.xml

You should be able to see the UI for Dolly:

The input files win-input.xml and mac-input.xml are the default XML documents that Dolly uses to generate projects. They define the properties of your new plug-in, such as whether you’re creating a model or a UI plug-in or if it is for InDesign or InCopy. It is not necessary to provide these files explicitly when running Dolly with UI.

Now close Dolly and try launching it with user interface disabled. To do that we’ll use the -q flag.

Windows:

DollyXs.bat -q win-input.xml

Mac:

DollyXs.sh -q mac-input.xml

If we look at mac-project-dir or win-project-dir attributes in the XML document we’ll see the location where the project was created. If you haven’t used Dolly before, the chance is that you got an error ‘Failed to create output file… ‘ when trying to create a project. It is because your mac-project-dir or win-project-dir point to an invalid location, like:

mac-project-dir="/id8sdk/build/mac/prj"

In the next part, we’ll try and use our own XML input file to generate projects using Dolly command line tool.

Creating custom input file

Copy win-input.xml or mac-input.xml and rename it myInputFile.xml. This is going to be the file we’ll be working on.

We’ll now define some general information about our plugin. Open myInputFile.xml and change author field to your name. Edit the value of long-name and change it to “MyPlugin”.

author="Alex"
long-name="MyPlugin"

We’ll also update the location of our project to something more suitable. That should fix any errors that we might have encountered before. Change mac-project-dir to /build/mac/prj and win-project-dir to /build/win/prj.

Dolly is going to generate some .cpp and header files for us. Let’s put them all in the same place so they are easily accessible. We can do this by assigning the same path to mac-id-header-dir, mac-source-dir, win-id-header-dir and win-source-dir. Make sure to use backslash for Windows paths or Dolly will throw an error when generating the project.

Even though we’re defining paths for source and header files twice, Dolly will create just one copy of each file. If you’re using Windows, Dolly will not create files in directories defined for Mac and vice versa.

The last changes we’re going to make are prefix-id and short-name. We’ll also set the type of our plug-in. The prefix-id of a plug-in is the ID value that InDesign will use to identify our plug-in. It is used to determine IDs of the boss classes, implementations and interfaces in our project. It must be a hexadecimal value. For the purpose of this tutorial, let’s set it to “0xef190”. For your own plug-ins, you need to obtain a unique prefix-id from Adobe Developers Connection.

Change the value of short-name to “MP”, short for MyPlugin. This attribute is used to prefix project file names for your plug-in. Therefore, it is advisable to keep it short.

prefix-id="0xef190"
short-name="MP"

We’re going to set the type of our plug-in to kUIPlugIn. Make sure the letter I is capital or Dolly will create a model plug-in instead.

plugin-type="kUIPlugIn"

Generating MyPlugin

It’s time to use our XML file to generate MyPlugin project with Dolly.

Windows:

DollyXs.bat -q myInputFile.xml

Mac:

DollyXs.sh -q myInputFile.xml

Once we run the command, Dolly is going to generate source files in /source/sdksamples/myplugin/ as we specified in our XML file.

Same with the project files. Our Xcode MyPlugin project will be generated in /build/mac/prj and Visual Studio project will be in /build/win/prj.

Open either MyPlugin.xcodeproj or MyPlugin.sln and you’re done! You’ve successfully created an InDesign plug-in using Dolly.

Find out more

If you would like to know more about manipulating the XML input file or Dolly in general, be sure to read the Readme.txt located in /devtools/sdktools/dollyxs/. You can find more information on InDesign Plugin development in the getting-started.pdf in /docs/guides/.

]]>http://blogs.adobe.com/indesignsdk/dollyxs-command-line-tool/feed/0Using EVE for UI layouthttp://blogs.adobe.com/indesignsdk/using-eve-for-layout/
http://blogs.adobe.com/indesignsdk/using-eve-for-layout/#commentsWed, 19 Dec 2012 16:20:46 +0000http://blogs.adobe.com/indesignsdk/?p=32Continue reading →]]>The Adobe Express View Engine (EVE) is the recommended method of laying out UI widgets in InDesign dialogs. The main benefit of using EVE is that widget geometry is calculated for you, so that when you add or remove widgets to a dialog all of the other widgets are shifted automatically without you having to recalculate sizes etc.

Benefits of using EVE

Updating dialogs by adding and removing widgets is made easier because the layout of all widgets is adjusted for you.

Where text is different sizes on different operating systems you don’t have to worry about calculating extra whitespace.

English dialogs can be smaller because you don’t need to leave room for anticipated localised text, so your dialogs look good in all languages.

EVE automatically resizes text, buttons, checkboxes, radio buttons and drop-down lists so you needn’t worry about text being clipped.

A quick introduction to EVE

In order to use EVE widgets in your dialog definitions you’ll need to add an include to your FR file.

#include "EveInfo.fh"

This file is a very useful resource since it lists all of the EVE widgets which are available out of the box, so do have a look inside.

In order to have your dialog use EVE you’ll need to add WidgetEveInfo to its type definition.

Finally you can change your dialog definition to use EVE by changing it to use EVE widgets and by adding the necessary EVE layout constants to the dialog itself (since you’ve now made the dialog an EVE dialog by adding WidgetEveInfo to its type definition).

Since all dialogs have an OK and Cancel button and some other content, here’s a complete dialog definition that uses EVE to layout an OK and Cancel button.

If you are familiar with InDesign plug-in development you’ll notice that the general format of the dialog definition is the same as usual except for some EVE layout additions and the use of widget names prefixed with EVE.

How do I convert my existing dialogs to use EVE?

The InDesign plug-in SDK includes an EVEConverter tool which enables you to very quickly EVE-ize your dialog definitions however it’s output is less than optimal. Be aware that the tool will also convert any panel definitions to use EVE so you should keep a backup copy of your original FR file so that you can replace the EVE-ized panel definition with your original non-EVE panel definition. The EVEConverter tool is a great first step to get a feel for EVE and how to use it.

Once you are better acquainted with EVE it becomes easier to hand craft your conversions or do some of them by hand. It all depends on how complex your dialogs are and if you are using any custom widgets. As a rule of thumb you might use the EVE converter first, then go over the output by hand to remove any excess spacer widgets or superfluous generic panel definitions.

]]>http://blogs.adobe.com/indesignsdk/using-eve-for-layout/feed/3Running a script from an InDesign plug-inhttp://blogs.adobe.com/indesignsdk/running-a-script-from-an-indesign-plug-in/
http://blogs.adobe.com/indesignsdk/running-a-script-from-an-indesign-plug-in/#commentsWed, 19 Dec 2012 10:05:31 +0000http://blogs.adobe.com/indesignsdk/?p=19Continue reading →]]>Perhaps you’ve come to native plug-in development from a more script-based background, or perhaps you have some existing script code you want to reuse in a new plug-in project. Whatever your background, it’s really handy to be able to run a script from a native plug-in, and it’s also surprisingly easy.

The code below works out of the box so you can copy and paste as much as you please.

The above code uses JavaScript but you may use any script manager you like, including kAppleScriptMgrBoss for AppleScript and kOLEAutomationMgrBoss for Visual Basic. For a complete list of available scripting managers see ‘Script managers’ in chapter 10 ‘Scriptable Plug-in Fundamentals’ of the Programming Guide Volume 1 included in the plug-in SDK (available at http://www.adobe.com/devnet/indesign/sdk.html).

]]>http://blogs.adobe.com/indesignsdk/running-a-script-from-an-indesign-plug-in/feed/0InDesign Server / OmniORB and Upgrading to Mac OS 10.6http://blogs.adobe.com/indesignsdk/indesign_server_omniorb_and_up/
http://blogs.adobe.com/indesignsdk/indesign_server_omniorb_and_up/#commentsWed, 23 Sep 2009 14:14:22 +0000http://blogs.adobe.com/indesignsdk/2009/09/indesign_server_omniorb_and_up.htmlContinue reading →]]>Here’s a nugget that will be of interest to those of you who regenerate Java/CORBA support for InDesign Server on the Mac. If you upgrade to Mac OS 10.6, you must rebuild the OmniORB tools with an x86_64 target to ensure that they run correctly. Setting up the OmniORB tools is coverred in Regenerating the Adobe InDesign CS4 Server Java API. You should get the x86_64 target by rebuilding the tools on the upgraded machine.
]]>http://blogs.adobe.com/indesignsdk/indesign_server_omniorb_and_up/feed/0