Highlighted

How to place a menu item?

Advocate ,
Sep 17, 2019

Copy link to clipboard

Copied

Dear all,

To identify the current FM session (whether it is 13, 14 or …) I want to place a small menu-item with just the FrameMaker major version as label. My script works fine with the exception that the location is  not very useful:

MenuPosition.png

How can I place it to very left after the application icon?

// FMident.jsx
#target framemaker
main ()

function main (){
var bkFMidMenu, docFMidMenu, menuLocation, oMenus = {}, oCmd = {};
var sVmajor ="15";                                // to be evaluated programmatically

  oMenus.MenuMain = sVmajor;                      // top menu can not execute a command
  oMenus.MenuInfo = "Information";
  menuLocation = app.GetNamedMenu("!MakerMainMenu");
// --- Command definition for documents and books
  oCmd.MenuInfo   = DefineCommand(1,"FMid",  oMenus.MenuInfo, "");
  oCmd.bkMenuInfo = DefineCommand(1,"FMid",  oMenus.MenuInfo, "");;
// --- Assign commands to menus
  menuLocation = app.GetNamedMenu("!MakerMainMenu"); 
  docFMidMenu  = menuLocation.DefineAndAddMenu("!FMidMain", oMenus.MenuMain); // ! required for top menu
  bkFMidMenu   = menuLocation.DefineAndAddMenu("!FMidMain", oMenus.MenuMain); // ! required 

  docFMidMenu.AddCommandToMenu (oCmd.MenuInfo);
  bkFMidMenu.AddCommandToMenu (oCmd.bkMenuInfo);

  UpdateMenus();
}

function Command(cmd) { // ========================================================================
	switch(cmd)  {	                                // Respond to menu command.
		case 1: 
      Alert ("This info will be about the current FM version, system etc.\nAnd it will be copied to the clipboard for arbitrary use.");
      break;
    }
} // --- end Command
TOPICS
Scripting

Views

301

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

How to place a menu item?

Advocate ,
Sep 17, 2019

Copy link to clipboard

Copied

Dear all,

To identify the current FM session (whether it is 13, 14 or …) I want to place a small menu-item with just the FrameMaker major version as label. My script works fine with the exception that the location is  not very useful:

MenuPosition.png

How can I place it to very left after the application icon?

// FMident.jsx
#target framemaker
main ()

function main (){
var bkFMidMenu, docFMidMenu, menuLocation, oMenus = {}, oCmd = {};
var sVmajor ="15";                                // to be evaluated programmatically

  oMenus.MenuMain = sVmajor;                      // top menu can not execute a command
  oMenus.MenuInfo = "Information";
  menuLocation = app.GetNamedMenu("!MakerMainMenu");
// --- Command definition for documents and books
  oCmd.MenuInfo   = DefineCommand(1,"FMid",  oMenus.MenuInfo, "");
  oCmd.bkMenuInfo = DefineCommand(1,"FMid",  oMenus.MenuInfo, "");;
// --- Assign commands to menus
  menuLocation = app.GetNamedMenu("!MakerMainMenu"); 
  docFMidMenu  = menuLocation.DefineAndAddMenu("!FMidMain", oMenus.MenuMain); // ! required for top menu
  bkFMidMenu   = menuLocation.DefineAndAddMenu("!FMidMain", oMenus.MenuMain); // ! required 

  docFMidMenu.AddCommandToMenu (oCmd.MenuInfo);
  bkFMidMenu.AddCommandToMenu (oCmd.bkMenuInfo);

  UpdateMenus();
}

function Command(cmd) { // ========================================================================
	switch(cmd)  {	                                // Respond to menu command.
		case 1: 
      Alert ("This info will be about the current FM version, system etc.\nAnd it will be copied to the clipboard for arbitrary use.");
      break;
    }
} // --- end Command
TOPICS
Scripting

Views

302

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
Sep 17, 2019 0
Mentor ,
Sep 17, 2019

Copy link to clipboard

Copied

Hi Klaus,

 

There is supposed to be a way to do it, I believe by setting the NextMenuItemInMenu or PrevMenuItemInMenu property with something, then FrameMaker automatically figures out where to move the menu. Or command. But to my knowledge, they do not work in ExtendScript, unless something was fixed recently. They work in the FDK. There have been discussions about it. I can't remember if it was here or another forum.

 

Russ

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...
Sep 17, 2019 0
Advocate ,
Sep 18, 2019

Copy link to clipboard

Copied

Ah, Russ, now I remember: it is bug FRMAKER-6714

This is the same as FRMAKER-2752 reported earlyer ...

So I will try to do something in the menu files - but I fear this does not work either.

Edit:

I added the following to the etb-menus.cfg file and it works as expected:

   <Order !MakerMainMenu.!FMidMain     <Before !MakerMainMenu.FileMenu>>

 FMident-menu.png

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...
Sep 18, 2019 0
Adobe Employee ,
Sep 18, 2019

Copy link to clipboard

Copied

THanks Klaus and Russ. We will try and pick this up sometime in Dec/Jan. Maybe we can discuss more on tekom Adobe partner day Klaus.

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...
Sep 18, 2019 1