Dockable Script
  • Folks,

    So I have a script I've made that I'm quite happy with.  It basically has six buttons on it that call six additional scripts.  I'd like to convert it to a dockable script.  Is there a standard procedure for converting regular script windows to a dockable palette?  Basically, I'd like to take the "demo palette" jsx file that comes with AE and make it dockable.  Anyone care to share some wisdom on how to do this?
  • First put the script file in the Scripts/ScriptUI Panels folder. Then in your script file, put the whole content of you script inside a function that takes a window as argument, and call that function by passing it the "this" variable:

    function myScriptPanel(wnd)
    {
    /// put all the code you already have here
    }

    myScriptPanel(this);

    When you put a script in that folder, the "this" variable represents the panel that AE creates for you. So if you use the wnd variable instead of the window you created in your script, you'll add your buttons to the panel instead. You don't need to call wnd.show() here since the panel will already be open.
    Remember to call wnd.layout.layout() or wnd.layout.layout() at the end of the function to make sure the auto-layout is applied.
  • You will also get more help over at the Adobe scripting forums so would suggest you ask for help over there as well.
  • Another great resource can be downloaded from here: http://www.kahrel.plus.com/indesign/scriptui.html
This discussion has been closed.
All Discussions