Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Closing Windows Issue on Dockable Panel??

$
0
0

Hello After effects insane coders ...

 

I've been trying to resolve this issue for quite some time now. I've tried everything possible, but I can not get any kind of feedback when "myWindow" is closed.

I need to be able to make modifications and save some changes when the user closes the main window or simply when it closes After Effects.


I need to be able to close all other windows that are open when closing "myWindow".

I'm trying this with the onClose function on line 89.

But the function returns no result.

 

I would also like to be able to save some data when the user closes After Effects, as I can not detect when "myWindow" is closed ... I also can not save this data.

 

Below is my complete code ...

I'm almost giving up...

If some charitable soul can help me, I thank you deeply ...

 

Thanks for all...

 

Rubens

 

 

 

 

 

(function(thisObj) {


var scriptPalette = scriptBuildUI(thisObj);
if (scriptPalette !== null && scriptPalette instanceof Window) {
scriptPalette.center();
scriptPalette.show();
} else {
scriptPalette.alignment = ["center","center"];
scriptPalette.alignChildren = ["center","center"];
scriptPalette.layout.layout(true);


}


scriptPalette.onResize = function(){scriptPalette.layout.resize (); }  


function scriptBuildUI(thisObj) {
   
var myWindow = (thisObj instanceof Panel) ? thisObj : new Window("window", "WINDOW TEST", undefined, {name: "WINDOW TEST", resizeable: true}); // HA_replaced prefs.script.name with "WindowName"
//myWindow.borderless = true;
myWindow.margins = [5,0,0,0];
myWindow.alignChildren = ["center","center"];
myWindow.alignment =  ["center","center"]; 




var mainGRP = myWindow.add("group", undefined, "mainGroup", {borderless: true});
    mainGRP.orientation = "column";    mainGRP.alignment = ["center","center"];     mainGRP.margins = [0,0,0,0];    mainGRP.spacing = 0;    mainGRP.visible = true;            var headerGRP = mainGRP.add("group", undefined, "mainGroup", {borderless: true});    headerGRP.orientation = "column";    headerGRP.alignment = ["center","center"];     headerGRP.margins = [0,0,0,0];    headerGRP.spacing = 0;    headerGRP.visible = true;    headerGRP.borderless = true;           var mainButton = headerGRP.add("button", undefined, "Main Header");    mainButton.text = "Click to open new window"    mainButton.alignment = ["center","center"];     mainButton.margins = [0,0,0,0];    mainButton.bounds = [0,0,200,200];            mainButton.onClick = function(){ second_Win.show();}    




var second_Win = new Window("palette", "", undefined, {closeButton: true});     second_Win.orientation = "column";    second_Win.maximumSize.height = 700;  second_Win.maximumSize.width = 300;  second_Win.margins = [10,10,10,20];  second_Win.spacing = 0;     var second_Win_headerGRP = second_Win.add("group", undefined, "mainGroup", {borderless: true});    second_Win_headerGRP.orientation = "row";    second_Win_headerGRP.alignment = ["center","center"];     second_Win_headerGRP.margins = [0,0,0,0];    second_Win_headerGRP.spacing = 0;    second_Win_headerGRP.visible = true;    second_Win_headerGRP.borderless = true;        var secondWindowButton = second_Win_headerGRP.add("button", undefined,  "second window")    secondWindowButton.text = "This is the second window"    secondWindowButton.alignment = ["center","center"];     secondWindowButton.margins = [0,0,0,0];    secondWindowButton.bounds = [0,0,200,200];        second_Win.onClose = function(){ alert("SECOND WINDOW IS CLOSING")};    myWindow.onClose = function(){ second_Win.close(); alert("MAIN WINDOW IS CLOSING")};


return myWindow




} //UI Creation End.//




return
})(this);    

Viewing all articles
Browse latest Browse all 2143

Trending Articles



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