Skip to main content
K.Daube
Community Expert
Community Expert
Mar 9, 2020 9:34 AM UTC
Answered

Add menu to Context menu

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.
    Klaus Göbel
    Klaus GöbelCorrect answer
    Legend
    Mar 9, 2020 10:25 AM UTC

    Hi Klaus,

    you have to use quotes:

    app.GetNamedMenu ("!TextContextMenu");

     

    2 replies

    Klaus Göbel
    Klaus GöbelCorrect answer
    Legend
    Mar 9, 2020 10:25 AM UTC

    Hi Klaus,

    you have to use quotes:

    app.GetNamedMenu ("!TextContextMenu");

     

    Translate
    K.Daube
    Community Expert
    K.DaubeCommunity ExpertAuthor
    Community Expert
    Mar 9, 2020 10:35 AM UTC

    My goodness - blind eyes...

    Translate