IDScriptingEventAdapter ?

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

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

Similar Messages

  • "Copy and Paste"-Event in Indesign

    Hi everyone,
    does anyone have an idea, if there is SOMEWHERE an event, which is fired upon "copy and paste"-ing one or multiple object in Indesign?

    Okay, since no one seems to answer in this forum anymore and I hope to help someone else wo might look for this problem in the future, here is a solution:
    Normally, all your events/eventlisteners have to target "a File or a JavaScript", which is pretty worthless, since we are in an ActionScript environment. The MIGHT be a fancy way to create a meaningfull workflow for this, but since all documentations, tutorials, cookbooks etc. on this have vanished into oblivion, here is what you should do.
    - Check if the source of the Event is a child of CSHostObject. If not, you might have a problem
    - Let´s pretend it is, then use the IDScriptingEventAdapter to catch your events. Here is an example which works for me to detect if a "Paste" happens
    private function pluginComplete():void{
         // in my project, this function is called once the plugin has been initialized.
         // the ID 271 is for "Paste". If you need another one, you might need to fiddle around with the items within the menuActions-Object
         IDScriptingEventAdapter.getInstance().addEventListenerToObject(MenuAction.AFTER_INVOKE, menuActionHandler, InDesign.app.menuActions.itemByID(271));
    private function menuActionHandler(e:*):void{
      trace("AN EVENT !!!", e)

  • Who's right?

    Hello,
    I was having a look to some documentation.
    In the official "Creative Suite Extension Builder" documentation, in the "Product-specific Guides > InDesign Guide" chapter, I found this:
    Custom menus in InDesign
    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 InDesign 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 InDesign CS5 SDK (http://www.adobe.com/devnet/indesign/sdk/). .
    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/.
    But, inside the InDesign CS5 SDK, I found this on the "feature-development-with-scripting.pdf" (see page 23):
    Overriding default menu placement
    N O T E : Overriding the default menu position is supported by InDesign, but not yet by other Creative Suite applications.
    By default, CSXS supports a single main menu item, which appears in the application’s Window > Extensions menu. Extension developers may prefer a different menu location. InDesign sup- ports a Menu element and Placement attribute in the manifest.xml that allows an extension to override the default menu position. For example:
    <Menu Placement="'Main:&amp;Window',600.0,'KBSCE Window menu'">FlexUIStroke</Menu>
    The Placement attribute needs to be created with care. See the FlexuUIStroke code for a more precise example (without a line break).
    Strings must be enclosed in single quotes.
    Commas (without white space) are used to separate fields.
    Who's right?
    Thank you,
    Luca

    Well, I have not tried either of those methods myself; but, they do work.
    If all you want to do is place the menu in a custom location, using the InDesign specific menu placement tag is the easiest, best, and recommended solution.
    In the latest SDK update we've included event support for InDesign, Photoshop, and Illustrator. That opens yet one more door for you.
    If your needs are significantly more complex, by that I mean -
    You need fully custom menu structure (such as adding your own menu to the main, with a menu tree under that)
    You need to turn menu items on or off based on application/document state
    You need to create and manage context menus
    Here's how you would go about it:
                mainMenu = InDesign.app.menus.item( "$ID/Main" ).submenus.add( "My Menu" );
                var handler1Action: ScriptMenuAction = InDesign.app.scriptMenuActions.add( "The First Menu" );
                IDScriptingEventAdapter.getInstance().addEventListenerToObject( "onInvoke", myEventHandler, handler1Action )
                var handler1MenuItem: MenuItem = mainMenu.menuItems.add( handler1Action, LocationOptions.AT_END );
            public function myEventHandler( evt: Event = null ): void
                trace( "Menu Event fired" );
    To do context menus, I would suggest looking at Ole's extendscript examples and simply extrapolating that technique to ActionScript and using the IDScriptingEventAdapter for event support.
    Regards
    Bob

Maybe you are looking for

  • Reversing the cleared document

    Hi experts, My client posted a wrong transaction in PRD system considering the Cheque Deposit Account instead of Cheque Payment Account while making a payment. After this the transaction became cleared item, now when he is trying to reverse the docum

  • Writing SNMP Manager using SNMP4J

    Hello, I am writing a SNMP Manager that is supposed to do the following: (1) Send snmp commands to snmp-agents, and handle thier response. (2) receive snmp traps from snmp-agents. I am using SNMP4J software package for writing the snmp manager. I wou

  • IWeb/MobileMe not accepting comments

    Over the past week or so, I have had two people tell me that they can not leave comments on my blog. I have tried myself (from MacBook Pro, iPhone 4 and Dell/Windows) and can not get a comment to post. I get the pop-up comment window, enter my commen

  • VALUE BASED  PARTITIONING BETWEEN AN EXCEL AND DATABASE

    Can any1 help I have an EXCEL FILES and DATABASE. I want to make partitioning value-based between these sources. Thanks you in advances.

  • Domain migration of Oracle RAC nodes on windows 2008

    Hello masters, We are planning to migrate servers from old domain to a new domain due to company name change. That is, our DB servers named like db-node-x.old-domain.com will be migrated to db-node-x.new-domain.com. The servers are all on Windows 200