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

How to unregister script programmatically ?

$
0
0

Friends, Romans, Countrymen!

Lend me your ears! [Shakespeare: Julius Cesar]

 

During testing a script wich has a notification It is necessary to uninstall it every time before it is run again (after some modification). Doing this via the script catalog is at least time consuming.

If I do not do this, then old code may be executed and the Data Browser shows items which are no more in the script...I even have to start FM and the ESTK again and again during the tests. In the Notify function it is also not possible,

  • to set a breakpoint
  • to use $.writeln.

The only feedback functions are alert, Alert and Console. It is, however, possible to set a breakpoint in a called function. Since some of them are called from the Notify function I need to place several...

I have tried to place the unregistering code at the Cancel button of the dialogue the functions of which I'm testing:

wPalDS.g1.Cancel.onClick = function () {  wPalDS.close();  Notification (Constants.FA_Note_PostActiveDocChange, false);   // unregister script
}

But this does not work - the script is still registered after cancelling.

For debugging the Scripting Guide refers to the JavaScript Tools Guide - which does not touch such delicate situations at all.

 

Do You have a trick to see both the global items and the local (to a function) variables and objects in the Data Browser? Currently I use such constructs as var a1 ...:

function RefreshGlobalsDS () {
$.bp(true);  GetRefPageItems ("Ref-Locations");              // gasLocations  GetRefPageItems ("Ref-Formats");                // gasFormats  GetRefPageItems ("Ref-Schemes");                // gaoTxtSchemes
var a1 = gasLocations, a2 = gasFormats, a3 =  gaoTxtSchemes;  FillItemList (wPalDS.p0.tabL.g1.p1.listLocations,  gasLocations);  // undefined is not an object ????  FillItemList (wPalDS.p0.tabF.g1.p1.listFormats,    gasFormats);  FillSchemeList (wPalDS.p0.tabT.g1.p1.listSchemes,  gaoTxtSchemes);
}

Any tips and tricks at hand?


Viewing all articles
Browse latest Browse all 888

Trending Articles



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