10 Replies Latest reply on Dec 20, 2010 12:44 PM by Olav Martin Kvern

    IDScriptingEventAdapter ?

    Martel Yann

      Hello everybody,

       

      I am currently working on an extension panel for InDesign CS5.Developing it in Flash Builder4. This panel is used to add information to pageItems in the document.

      While I am quite familiar with Flex, I am kind of lost with the extension SDK. Using IDScriptingEventAdapter (from this source:http://blogs.adobe.com/cssdk/2010/08/makesideheads-a-complete-indesign-cs5-panel-2.html) , I managed to get notified when the selection changes, which is good. However, I can't find a way to be notified when an element is deleted.

      In the same way, I can't find an event telling me when a layer or a page is removed.

       

      Have I missed something or is it not possible at all ?

       

      Yann

        • 1. Re: IDScriptingEventAdapter ?
          Harbs. Level 6

          The IDScriptingEventAdapter is limited to scripting events built into InDesign. Those events do not exist.

           

          APID from rorohiko.com offers many additional events that might help you...

           

          Harbs

          http://www.in-tools.com

          Innovations in Automation

          • 2. Re: IDScriptingEventAdapter ?
            Martel Yann Level 1

            Thank you for your answer.

            I'm not sure I understand correctly though.

            Using the adobe CSSDK tools I can be notified when the selection changes, when a document is saved, etc..

            Are you saying the other events (item deleted, page deleted, etc..) don't exist at all or will they be added in the next version of the SDK ?

            I am just getting started with all this and it seems like the SDK is still a work in progress (for example olny 1 google hit and no documentation for IDScriptingEventAdapter).

            I think the SDK loses much of its usability if it won't allow us to have access to such basic events.

             


            Yann

            • 3. Re: IDScriptingEventAdapter ?
              Harbs. Level 6

              They do not exist at all. The IDScriptingEventAdapter is just an ActionScript wrapper on the ID events.

               

              APID has page item delete. It does not have page delete. Why do you need such an event?

               

              Harbs

              http://www.in-tools.com

              Innovations in Automation

              • 4. Re: IDScriptingEventAdapter ?
                Martel Yann Level 1

                Our panel is used to associate data to page items. The user selects an item, then uses our panel to define some data which is then saved inside a database.

                If the user decides to delete the item, we would like to be able to delete its associated data inside the database.

                 

                I think we'll have to synchrnoize the database only when the document is saved, checking if any of the items has been removed since the last save. This seems really inefficient since we are working on huge documents but it should do the trick.

                 

                Thank you for answering.

                 

                Yann

                • 5. Re: IDScriptingEventAdapter ?
                  Harbs. Level 6

                  That explains deleted page items. APID can help with that. Why do you need an event when a page is removed?

                   

                  Harbs

                  • 6. Re: IDScriptingEventAdapter ?
                    Martel Yann Level 1

                    For the same thing essentially: when a page is removed we'll have to delete the data of all its elements.

                    Apart from this particular issue, it seemed obvious to me that the CSSDK would provide all of these events (add/remove for items/pages/layers , modifications, property changes, etc...) but I think I misunderstood the SDK purpose and our particular usecase probably is borderline.

                     

                    Yann

                    • 7. Re: IDScriptingEventAdapter ?
                      Harbs. Level 6

                      You don't need a separate event for that. If you remove a page which in turn removes objects, you would get the events for those objects. Again; take a look at APID. It will help solve your problem...

                       

                      The CS SDK doesn't generally add features not available in the scripting DOM of the host application. It just offers ActionScript access to the DOM...

                       

                      Harbs

                      • 8. Re: IDScriptingEventAdapter ?
                        Martel Yann Level 1

                        Had a look at APID and my boss tells me its pricing won't work with us...

                         

                        Just out of curiosity, could you answer one last question.

                        If I understood correctly, APID extends the InDesign scripting model by adding more events to it. Does it mean that those additionnal events become available through the CS SDK automatically as long as the APID plugin is installed, or would there be extra steps involved ?

                         

                        Yann

                        • 9. Re: IDScriptingEventAdapter ?
                          Harbs. Level 6

                          There would be some extra steps involved, but it's not too difficult.

                           

                          If the pricing doesn't fit your needs, I'd suggest you contact Kris at Rorohiko and discuss your needs with him. He's a great guy, and might be able to work something out with you...

                           

                          Good luck!

                           

                          Harbs

                          • 10. Re: IDScriptingEventAdapter ?
                            Olav Martin Kvern Level 3

                            Hi Yann, Harbs,

                             

                            It's probably possible to find an event that will fire for these actions--when writing my most recent CS SDK blog post, I found that the AFTER_ATTRIBUTE_CHANGED event fires when a layer is deleted. It's possible that that same event fires when a page is removed. My point here is that even if there's no *specific* event that fires when an object is deleted, there may be some other, more general, event firing at that point. For example, AFTER_ATTRIBUTE_CHANGED seems to fire for a lot of different things, some of them unexpected. The event handling function just needs to figure out what happened.

                             

                            Thanks,

                             

                            Ole