6 Replies Latest reply on Sep 29, 2016 4:11 AM by Dargon Kong

    How to execute a command on a new added plugin panel by javascript?

    Dargon Kong

      I add a new plugin to Indesign. It is used to track text change.

      I have to press the 'new' button to add a new revision.


      I have so many files need to add new revision, so I have to press the 'new' button so many times.

      I can't execute the command through 'app.menuActions.item("????").invoke();'.

      Is there a way to "press the 'new' button" by Javascript?


      Here is the code:


      for(c1 = app.documents.length - 1; c1 >= 0; c1--){

          if(app.documents.length != 1){

              app.documents[1].windows[0].bringToFront(); //loop all the opening files


          app.menuActions.item("new").invoke(); //the 'new' menu does not exist in fact.




      Thanks in advance.