Function not recognised when working via menu
Dear all,
My script for document navigation works fine as long as I do not use it via menu. Via menu the main function is not found:
Error Message : KLD_E.DocNav is not a function
Script, Line# : C:\Users\klaus\AppData\Roaming\Adobe\FrameMaker\15\startup\ETBdocNav.jsx, 85I can not find, why the function is not defined. I have changed the location of it withing the script (before the menu set-up, after it) - to no positive effect.
Any ideas?
KLD_E.DocNavMenu = function (){ // === Create menu entry ================
var menuLocation, oCmd = {};
// ---------------- Menu and Command definition for documents -------
menuLocation = app.GetNamedMenu("ViewMenu");
oCmd.MenuDnav = menuLocation.DefineAndAddCommand (1,"ETBdocNav", localize (KLD_E.sDnav_title), "\\!qdn");
oCmd.MenuDnav.KeyboardShortcutLabel = "ESC q d n";
UpdateMenus();
} // --- end KLD_E.DocNavMenu
function Command(cmd) { // ==============================================
switch(cmd) { // Respond to menu command.
case 1:
KLD_E.DocNav();
break;
}
} // --- end Command
KLD_E.DocNav = function (location, bTag) { // === Main function =======
// Arguments location Current screen location of palette. used for resize
// Called by -
// Calling KLD_E.BuildPalette, KLD_E.GetParagraphs
// Comment To be implemented in ETBdocNav
var aPgfs = [], oDoc, wDocNav;
if (bTag === undefined) {bTag = false};
oDoc = app.ActiveDoc;
if (!oDoc.ObjectValid()) {
Alert (localize (KLD_E.sDnav_docRequ), localize (KLD_E.sDnav_title), true);
return;
}
if (!KLD_E.GetLevelSettings(KLD_E.oLevelSettings)) {return;};
KLD_E.GetParagraphs (oDoc, aPgfs, KLD_E.oLevelSettings);
wDocNav = KLD_E.BuildPalette (oDoc, aPgfs, KLD_E.oLevelSettings, bTag);
if (location) {
wDocNav.bounds = location; // Restore the palette's previous size and location on the screen.
}
} // end of KLD_E.DocNav
