Copy link to clipboard
Copied
Tested with 16.0.3.979 and
Bugs FRMAKER-6714, FRMAKER-2752 are back. They were resolved in 16.0.0.663 M4. I did not test between then and now - but now in update 3 the problem is back.
You may use the following test script
/* CheckMenuPosition.jsx ------ UTF-8 --------------------------------------
position this menu item below Find Next in Edit
Comment This should work correctly starting with FM-16.0.0
History 2021-11-30
*/ ; // =====================================================================
//@target framemaker
if (typeof KLD_Z == "undefined") {
KLD_Z = {}; // Global script object for this suite
}
KLD_Z.Main = function () { //=== =========================================
var CMenuPos, menuLocation, nearbyCmd, oMenus = {}, oCmd = {};
// --- Menu entries (could be integrated in to command definitions as strings)
oMenus.MenuMain = "Check Menu Position";
oMenus.MenuDocu = "Menu Postion - documentation";
oMenus.MenuHandle = "Menu Position - submenu";
// --- Command definition for documents and books
oCmd.MenuMain = DefineCommand(1,"CMenuPos_Main", oMenus.MenuDocu, "");
oCmd.MenuDocu = DefineCommand(2,"CMenuPos_Docu", oMenus.MenuDocu, "\!qqy");
oCmd.MenuHandle = DefineCommand(3,"CMenuPos_Handle", oMenus.MenuHandle, "\!qqz");
// --- Shortcut labels
oCmd.MenuDocu.KeyboardShortcutLabel = "ESC q q y";
oCmd.MenuHandle.KeyboardShortcutLabel = "ESC q q z";
// --- Assign commands to menus
menuLocation = app.GetNamedMenu("EditMenu");
CMenuPos = menuLocation.DefineAndAddMenu("!CMPMain", oMenus.MenuMain); // ! required
CMenuPos.AddCommandToMenu (oCmd.MenuDocu);
CMenuPos.AddCommandToMenu (oCmd.MenuHandle);
nearbyCmd = app.GetNamedCommand("FindNext");
oCmd.MenuMain.PrevMenuItemInMenu = nearbyCmd;
UpdateMenus(); // refresh and actually make the new menu appear
} //--- end SetUpMenus ------------------------------------------------------
function Command (cmd) { // =================================================
// Assign functions to menu commands
switch (cmd) {
case 1:
Alert ("This should be below the menu «Find Next»", "CMP", false);
break;
case 2:
Alert ("Documentation is still empty - look out of the window and make a poem", "CMP", false);
break;
case 3:
Alert ("Leider bleibt der hundedreck\nim winter unterm schnee versteckt!", "CMP", false);
break;
}
} //--- end Command ----------------------------------------------------------
KLD_Z.Main ();
Amitoj commented mid 2020:
The main issue was that the command which we were running from ESTK had to parent menu id attached to it and internally it was passing 0. There was also no mechanism to pass the parent menu id of the created command. Internally the code checks for the menu id of the command. In FDK we can pass the menu id but here we do not have a provision to do something like menu.cmd or menu.GetNamedObject.
To fix this we created a field ParentMenuId in which the menu id of the command can be set. Sample is as follows …
Copy link to clipboard
Copied
Hi Klaus,
In the modifed script that Adobe have added to the bug report, the line 'cmd.ParentMenuId = menu;' fixes the problem of new command positioning for 16.0.1, at least. With it in, the command is positioned as expected; without, the command is positioned at the end. Setting this property makes no difference for 15.0.8.
I have added a comment on the bug report that this seems like a work around to me as you could reasonably expect the menu.DefineAndAddCommand to return a command object with this property set.
Jon