Skip to main content
K.Daube
Community Expert
Community Expert
September 17, 2019
Question

How to place a menu item?

  • September 17, 2019
  • 1 reply
  • 1236 views

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:

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
This topic has been closed for replies.

1 reply

Legend
September 18, 2019

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

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
September 18, 2019

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

 

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