12 Replies Latest reply: Sep 22, 2014 7:50 AM by Timothy Brand-Spencer RSS

    How to open an extension programatically?

    maddy1907 Community Member

      Hi,

       

      I would like to open an extension from my cpp code. How can I do it?

       

      Regards

      maddy1907

        • 1. Re: How to open an extension programatically?
          dinghui Community Member

          Hi,

           

          Which Adobe Application are you using?

          You will need to use the native SDK of the application. And also, the application SDK must exposes a header file named PlugPlug.h. If the header file is available, then you can use the PlugPlugLoadExtension API to load an extension with specified extension ID.

          • 2. Re: How to open an extension programatically?
            maddy1907 Community Member

            Oops I forgot to mention I'm using developing a plug-in in indesign and coupling it with an extension. Where exactly is the extension ID? and is there an sample which illustrates this? I have not packaged my extension yet. I'm making a html5 extenion

            • 3. Re: How to open an extension programatically?
              dinghui Community Member

              Hi,

               

              In your extensions's root folder, open CSXS/manifest.xml, then you will see the extension ID. Or, when you are creating your extension in Extension Builder, there should be step asking you to give the extension an ID.

               

              I will involve guys from the InDesign SDK team to help you with the native InDesign Plug-in question.

              • 4. Re: How to open an extension programatically?
                maddy1907 Community Member

                Thanks a lot, I guess it's within the tag ExtensionBundleId= "com.example.myextensionname".

                 

                I can find the code for adding a custom event listener to my extension but cannot find a way to load it.

                • 5. Re: How to open an extension programatically?
                  Timothy Brand-Spencer Adobe Employee

                  I work on the InDesign SDK. I'm not sure exactly which version of InDesign you are developing plug-ins for, but given you are also creating HTML extensions I assume you are using InDesign CC 9.1 or later.

                   

                  There is no public API in InDesign for you to launch an extension from a plug-in. It is more common for the reverse of what you are talking about: an extension (with menu item and UI) that calls into native plug-in APIs.

                   

                  However....

                   

                  In InDesign CC 9.0 we exposed some plugplug APIs for the first time, enabling you to construct and dispatch CSXS events from native InDesign plug-ins. The file is: <sdk>/source/public/interfaces/ui/ICSXSPlugPlugEventHandler.h.

                   

                  We also added a new sample to the SnippetRunner sample demonstrating how to use the new plugplug APIs (see: <sdk>/source/sdksamples/codesnippets/SnpHelloCSXS.cpp).

                   

                  More recently I wrote a blog post about communication between native plug-ins and HTML extensions, here: https://blogs.adobe.com/indesignsdk/html-extensions-in-indesign/.

                   

                  We might consider exposing this functionality in a future release. If you are a member of the pre-release program perhaps you could raise a bug about this? If not I can raise the subject internally. If this did happen, it wouldn't be overnight so I would definitely try an alternative workflow for your plug-in/extension in the mean time. Can you share why you wish to launch the extension from the plug-in and not the other way round? Perhaps we can help you find a workaround.

                   

                  Tim

                  • 6. Re: How to open an extension programatically?
                    maddy1907 Community Member

                    Hi Tim,

                     

                    Thanks for the quick reply. I've designed a login dialog in Indesign sdk. On a successful login, I need to bring up my extension panel (based on credentials)which is quite complex, so I decided to make a html5 extension of it.

                     

                    Yes, I'm a part of the prerelease program.Thanks for the link, I had already implemented that into my plug-in.

                     

                    Edit: Feature filed.

                     

                    ID: 3697891

                     

                    This is my first feature request. I hope I've done it in the correct manner.

                    • 7. Re: How to open an extension programatically?
                      pierrel Community Member

                      Hi!

                       

                      Have you any estimation as to when this feature will be implemented? This is actually preventing me from making my plug-ins work with InDesign CC...

                      • 8. Re: How to open an extension programatically?
                        Caleb Clauset

                        Our desire (at Typefi) is to have all of our plug-ins/extensions be grouped under the same Windows submenu (e.g., Windows → Typefi) rather than the C++ plug-ins appearing in one location and the HTML extensions appearing elsewhere. If it's not possible to relocate the HTML extension directly, then a fallback would be a stub C++ plug-in that would appear in the correct location that simply launch the HTML extension (panel).

                        • 9. Re: How to open an extension programatically?
                          maddy1907 Community Member

                          I noticed that under Help>What's New, the palette that appears is a modeless dialog which is HTML5 extension. Therefore there's surely a way to change the menu item's location other than the extensions location but probably it's not exposed to the third party developers.

                           

                          This was the reply I got from adobe on 3rd March 2014

                           

                          [Internal 3/10/2014 3:25:33 AM] Thank you for logging this enhancement request. We are adding it to our database of feature requests and presently closing it from the bug-base.

                          • 10. Re: How to open an extension programatically?
                            Timothy Brand-Spencer Adobe Employee

                            maddy1907 We have made the APIs you need public ;-). They will be available in the next InDesign SDK release, but you will be able to access them sooner than that if you still have access to the pre-release site. The file you will need is <SDK>/source/public/interfaces/ui/ICSXSPlugPlugExtensions.h and the two APIs are LoadExtension(...) and UnloadExtension(...). Hopefully pierrel will find this useful too.

                            • 11. Re: How to open an extension programatically?
                              maddy1907 Community Member

                              Thanks Tim. This will be really helpful!

                              • 12. Re: How to open an extension programatically?
                                Timothy Brand-Spencer Adobe Employee

                                Regarding the question fromCaleb Clauset..

                                 

                                If you want to group menu items for extensions together in your own sub-menu, try this:

                                 

                                <Menu Placement="'Main:&amp;Window:.&amp;Typefi',100.0,'KBSCE Window menu'">Menu Item</Menu>

                                 

                                You can also use this menu path in your native plug-ins so that, if they have menus, those menus appear in your own menu too.

                                 

                                Hope this helps!

                                 

                                Tim