List of commands not reliable...
Friends, Romans, Countrymen, I wanted to create a list of commands with this (now stripped down) script:
// ListCommands2.jsx ====== UTF-8 ======================================
//@target framemaker
var KLD_Z = KLD_Z || {}; // global script object
KLD_Z.main = function () { // <><><><><><><><><><><><><><><><><><><><><>
$.bp(true);
var j=0, line, cmd = app.FirstCommandInSession;
while (cmd.ObjectValid()) {
line = cmd.Name + "\t" + cmd.Label+ "\t" + cmd.Fcodes + "\t" + cmd.KeyboardShortcuts;
// $.writeln (j, " ", line);
j += 1;
cmd = cmd.NextCommandInSession;
}
$.writeln ("Finito ", j-1, " ", line);
} //--- end main -------------------------------------------------------
KLD_Z.main ();
In ESTK the script run for a while - visually not recognisable, because the initial breakpoint is highlighted and the round indicator spins. If you have the $.witeln active, then after a while the log shows much output, but stops amids the list, which later is continued to (in my case) line 1383 which is (found by other means) really the last valid command.
After this the script is spinning and nothing happens any more. Terminating the script yields the status message «Execution halted: Adobe FrameMaker 2019 (15.0) did not respond.». FM must be killed.
By other means (looping to command 1380 and then stepping) I found that at this point
cmd.NextCommandInSession is null. The while can not handle this ????
{With acitvated $.writeln you get only the last portion of the list, not the full list. In the real script i pushed the lines into an array which I later wanted to copy to a file}
