Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions ScriptsUI: Closing Panels and Saving Data

  • ScriptsUI: Closing Panels and Saving Data

    Posted by David Conklin on March 24, 2015 at 3:22 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

    David Conklin replied 11 years, 1 month ago 1 Member · 1 Reply
  • 1 Reply
  • David Conklin

    March 24, 2015 at 8:18 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy