3 Replies Latest reply on Mar 25, 2014 6:54 AM by TᴀW

    How to open and close files from UIwindow my function doesn't work

    Dapeamel Level 1

      Hello guys!

      I am trying to create a simple ui-interface.

       

      I made one button so far.

       

      but my function does not work.

       

      if I run the function without dialog box it works perfectly!

       

      when I running the function in the dialog window, picking a file and open, nothing happens why?

      please help me with a correct code.

       

      also how do I write  2 functions that also closing a file and  saving a file?

       

      here is my simple code.

       

      var w = new Window ("dialog");

      button.onClick = function () {

      OpenMyFile();

          }

      w.show ();

       

      function OpenMyFile(){

      var myFile = File.openDialog();

      app.open(myFile)

      }

       

       

      Thank you in advance.