1 Reply Latest reply on Feb 23, 2016 7:52 AM by Silly-V
      • 1. Re: How to link with any function to any Script UI (user interface) using javascript
        Silly-V Adobe Community Professional

        you assing some button an event handler which can run a function:

         

        function windowDemo(){

             var w = new Window("dialog", "test");

             var btn = w.add("button", undefined, "Test");

             btn.onClick = function(){

                  if(app.documents.length == 0){

                       alert("No documents open");

                       return;

                  }

                  alert("The name of the active document is: '" + app.activeDocument.name + "'");

             }

             w.show();

        }

        windowDemo();