Hi Klaus, here some scripts: EventTest1 alert ("Start TEST1","TEST1"); TestString = "First"; w1 = new Window("palette","My First Test",undefined); CloseButton = w1.add ("button",undefined,"close",{name:"cancel"}) w1.show(); CloseButton.onClick = function(){w1.close()}; Notification(Constants.FA_Note_PostMouseCommand,true); w1.onClose=GoodBye; function Notify(note, object) { switch (note) { case Constants.FA_Note_PostMouseCommand: { alert("TEST1: " + TestString,"TEST1"); break; } } } function GoodBye() { alert("BYE1","TEST1"); Notification(Constants.FA_Note_PostMouseCommand,false); }; EventTest2 alert ("Start TEST2","TEST2 "); TestString = "Second"; w2 = new Window("palette","My Second Test",undefined); CloseButton = w2.add ("button",undefined,"close",{name:"cancel"}) w2.show(); CloseButton.onClick = function(){w2.close()}; Notification(Constants.FA_Note_PostMouseCommand,true); w2.onClose=function(){alert("BYE2","TEST2")}; function Notify(note, object) { switch (note) { case Constants.FA_Note_PostMouseCommand: { alert("TEST2: " + TestString,"TEST2: "); break; } } } EventTest3 alert ("Start TEST3","TEST3"); TestString = "Third"; w3 = new Window("palette","My Third Test",undefined); CloseButton = w3.add ("button",undefined,"close",{name:"cancel"}) w3.show(); CloseButton.onClick = function(){w3.close()}; Notification(Constants.FA_Note_PostMouseCommand,true); w3.onClose=function(){alert("BYE3","TEST3")}; function Notify(note, object) { switch (note) { case Constants.FA_Note_PostMouseCommand: { alert("TEST3: " + TestString,"TEST3"); break; } } } Testsequence: - Open any document. - Start EventTest3 first, then EventTest2 and then EventTest1 DON'T CLOSE THEM YET, only click OK. You can see these scripts in your scriptlibrary (radiobutton registered) ordered like this: EventTest3 EventTest2 EventTest1 Because the dialogues are overlapping, move them. DON'T CLOSE THEM YET Click into the document at any place: Now you can see the alerts : - TEST3: First - TEST2: First - TEST1: First Now close all dialogs Click into the document at any place: Now you can see the alerts : - TEST3: First - TEST2: First "TEST1: First" is missing, because it is unregistered Have a look at the value of the variable "TestString" (First) Now restart FrameMaker and open any document. You can see in your scriptlibrary (radiobutton registered) registered scripts ordered like this: EventTest2 EventTest3 And when clicking into the document you'll get the order: TEST2: Third TEST3: Third because it now is in alphabetical order. If you NOW change EventTest2: alert("TEST2: " + TestString,"TEST2: "); to alert("New TEST2: " + TestString,"TEST2: "); you can see, that this is displayed. Means: if you have a real script where lots of things happen and you change the script (while it is still registered) this function is called and can cause what cou call "special effects" and of course: after the test you have to remove the registered scripts manually That demonstrates the danger within registering / not unregistering scripts and and also the usage of global variables. I hope, that helps to understand these things a little better. I also hope this does NOT lead to additional confusion.
... View more