FORUMS: list search recent posts

ScriptsUI: Closing Panels and Saving Data

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Conklin
ScriptsUI: Closing Panels and Saving Data
on Mar 24, 2015 at 3:22:36 pm

Hey there,

I am having some issues being able to close a window launched from the Window menu inside of AE. My palette works successfully when launched from File > Scripts but for some reason it misbehaves when treated as a dockable item.

My code looks something like this:


var w = (thisObj instanceof Panel) ? thisObj : new Window("palette", "myscript");

// window setup stuff here, including a cancel button.

cancelButton.onClick = function(){
w.close();
}

w.onClose = function(){
alert("closing!");
}


When launched from File > Scripts, clicking the close button or the red "X" at the top of the widow triggers the "closing" message and closes the palette. When run from scripts UI, ESTK opens up and reports "w.close is undefined."

This is mainly a problem because I am trying to store some data (a JSON file) when the script closes as to have a persistent set of information between sessions and uses. I've checked the ESTK and it appears that the Panel object does not have a .close() method, but I am unable to discern if this Panel object is describing the window panel or the 'group' panel. If I cannot close the palette for whatever reason, is there a work around for saving data when the user clicks the red X?

Thanks so much!

David

Relevant Tech info:
After Effects CC2014 (2014.2)
Mac OS X 10.9.5
Mac Pro (Late 2013)
Processor: 2.7 GHz 12-Core Intel Xeon E5
Memory: 32 GB 1867 MHz DDR3 ECC
Graphics: AMD FirePro D700 6144 MB

David Conklin
Motion Designer


Return to posts index

David Conklin
Re: ScriptsUI: Closing Panels and Saving Data
on Mar 24, 2015 at 8:18:28 pm

A bit of an update.. upon running this script via the Window menu in CS6, the red X button responds appropriately, though clicking the close button still does nothing. Any additional thoughts on this?

David Conklin
Motion Designer


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]