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

Add menu to Context menu

  • March 9, 2020
  • 1 reply
  • 1699 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 has been closed for replies.
    Correct answer Klaus Göbel

    Hi Klaus,

    you have to use quotes:

    app.GetNamedMenu ("!TextContextMenu");

     

    1 reply

    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...