Skip to main content
K.Daube
Community Expert
Community Expert
March 9, 2020
Answered

Add menu to Context menu

  • March 9, 2020
  • 2 replies
  • 1704 views

Dear all,

In a script I try to add a menu item to an existing context menu:

menuLocation = app.GetNamedMenu (!TextContextMenu);
oCmd.cmdDoc = menuLocation.DefineAndAddCommand (1, "ETB_InsertSymbol", "Insert special symbol [ETB]", ""); 

It is not a problem to do so in the menu.cfg file - but in the script it fails with error message

TextContextMenu is undefined

Note, that the ! has gone here.

It seems that scripts can't add to context menus.

What's Your opinion here?

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer Klaus Göbel

    Hi Klaus,

    you have to use quotes:

    app.GetNamedMenu ("!TextContextMenu");

     

    2 replies

    Klaus Göbel
    Klaus GöbelCorrect answer
    Legend
    March 9, 2020

    Hi Klaus,

    you have to use quotes:

    app.GetNamedMenu ("!TextContextMenu");

     

    K.Daube
    Community Expert
    K.DaubeCommunity ExpertAuthor
    Community Expert
    March 9, 2020

    My goodness - blind eyes...