Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Add menu to Context menu

Community Expert ,
Mar 09, 2020 Mar 09, 2020

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?

1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 09, 2020 Mar 09, 2020

Hi Klaus,

you have to use quotes:

app.GetNamedMenu ("!TextContextMenu");

 

Translate
Enthusiast ,
Mar 09, 2020 Mar 09, 2020

Hi Klaus,

you have to use quotes:

app.GetNamedMenu ("!TextContextMenu");

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2020 Mar 09, 2020
LATEST

My goodness - blind eyes...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines