Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

FM-14: strange behaviour of SetUpMenu function

$
0
0

Friends and gurus: I encounter a very strange situation!

The following script works correctly. The functions are called by a button.

#target framemaker

var gasETBViewSettings = [];                      // save the user settings
var gsETBMsgNoDoc   = { en: "No document active!",                        de: "Kein dokument aktiv!"                      };
// alert ("ETBToggleViewsA really entered");
SetUpMenu();

function SetUpMenu() { // ==== Define the menu - even if not used =================================
var sLabelEditing, sLabelPrinting, menuLocation, cmdDoc1, cmdDoc2;
  menuLocation = app.GetNamedMenu("ETBdummy");    // Required, even if not used  cmdDoc1 = DefineCommand (1, "EditingDisplay",  "Document Editing Display [ETB]",  "\!qqe");  cmdDoc2 = DefineCommand (2, "PrintingDisplay", "Document Printing Display [ETB]", "\!qqp");  UpdateMenus();
} // --- end SetUpMenu

function Command(cmd) { // ==== Respond to menu/TB command ==================================
alert ("ETBToggleViewsA command " + cmd + " entered");
    switch(cmd)  {        case 1:      SetEditingDisplay();      break;        case 2:      SetPrintingDisplay();      break;    }
} // --- end Command

function SetEditingDisplay () {
  alert ("SetEditingDisplay entered"); // of course there is more in here
}
function SetPrintingDisplay () {  alert ("SetPrintingDisplay entered"); // of course there is more in here
}

 

But if I insert the following after line 11, then the script does not work anymore (it is loaded, but the Command function does not issue the alert etc.).

  sLabelEditing  = { en: "Document Editing Display [ETB]",                     de: "Ansicht für Dokument Bearbeitung [ETB]" };  sLabelPrinting = { en: "Document Printing Display [ETB]",                     de: "Ansicht für Dokument Drucken [ETB]" };

 

It doesn't work either if I place the following after line 06:

var gsLabelEditing  = { en: "Document Editing Display [ETB]",                     de: "Ansicht für Dokument Bearbeitung [ETB]" };
var gsLabelPrinting = { en: "Document Printing Display [ETB]",                     de: "Ansicht für Dokument Drucken [ETB]" };

 

I have similar constructs in various scripts with no problems so far.

What is going on here?


Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>