Skip to main content
1-Visitor
May 20, 2013
Question

Non-existent menu item

  • May 20, 2013
  • 2 replies
  • 984 views
I have added an item to the Arbortext edit menu. It calls an external service. I used timer_add_callback to poll the service occasionally to see if the menu item should be available. Then I used menu_change to enable or disable the menu item appropriately.

This all works until the user uses "Edit selection as XML source", because that displays a new window. When the timer goes off, the menu item doesn't exist in the XML-as-source window, and an error dialog pops up.

I tried calling menu_change inside catch, like this:
catch( 'menu_change ".Edit.Use service" -active "$$polledOK" )

That stops the error dialog, and the catch returns 0. But the menu item state never changes.

- Am I doing something wrong in the catch?
- Or is there some way of telling if the menu item is available?
- Or is there a way to refer to the menu item in the right window?


Jonathan Reeve









This e-mail from Practical Law Company (

    2 replies

    18-Opal
    May 20, 2013
    Hi Jonathan--

    You can use the menu_exists() function to make sure the menu can be
    found before you try to update it.

    --Clay

    Clay Helberg
    Senior Consultant

    TerraXML
    1380 Forest Park Circle, Suite 100
    Lafayette, CO 80027
    1-Visitor
    May 20, 2013

    Thanks.


    menu_exists is what I was looking for.