9 Replies Latest reply on Aug 31, 2015 1:04 AM by Vamitul

    To select open documents

    hamdifem Level 1

      I'm trying to open many documents and I wrote a script to toggle between this document I hope you complete

      What can I do in the dialogue screen to switch to the document that I chose

       

      var no = 67494
      var myActions = app.menuActions;
      var w = new Window ("dialog");
      var myList = w.add ("listbox");
      for (var i = 0; i < app.documents.length; i++)
      myList.add ("item", " " + String(myActions.itemByID(no++).name));
      myList.preferredSize = [200,150];
      w.add("button", undefined, "OPEN", {name: "ok"}).onClick = function() {
      w.close(7);
      }
      if(w.show() == 7) {
      if(myList.selection[0]) {
      app.menuActions.itemByID(67494).invoke();
      }
      if(myList.selection[1]) {
      app.menuActions.itemByID(67495).invoke();
      }
      }