Highlighted

Add menu to Context menu

Advocate ,
Mar 09, 2020

Copy link to clipboard

Copied

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?

Hi Klaus,

you have to use quotes:

app.GetNamedMenu ("!TextContextMenu");

 

Views

1.1K

Likes

Translate

Translate

Report

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

Add menu to Context menu

Advocate ,
Mar 09, 2020

Copy link to clipboard

Copied

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?

Hi Klaus,

you have to use quotes:

app.GetNamedMenu ("!TextContextMenu");

 

Views

1.1K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 09, 2020 0
Enthusiast ,
Mar 09, 2020

Copy link to clipboard

Copied

Hi Klaus,

you have to use quotes:

app.GetNamedMenu ("!TextContextMenu");

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2020 0
K.Daube LATEST
Advocate ,
Mar 09, 2020

Copy link to clipboard

Copied

My goodness - blind eyes...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2020 0