3 Replies Latest reply on May 29, 2010 4:35 AM by Roy Marshall

    [JS] doScript Question

    Roy Marshall Level 1

      HI.

       

      I have used doScript in the past with success, but this time I am getting an error

      "Cannot handle the request because a modal dialog or alert is open" when running from ESTK, and the line: "app.doScript(myOpenScript);" is hightlighted.  From InDesign, nothing happens, not even an error.

       

      here is the bit of code I am using:

       

      myScriptFile = File("~/Making Tickets2.jsx");

      myScriptFile.open();

      myOpenScript = myScriptFile.read();

      myScriptFile.close();

      ...

      if(myButtonFive.value == true)

      {

      app.doScript(myOpenScript);

      }

       

      When I use the console I am told that the string "myOpenScript" is the correct script, The script it is running is a simple alert box.:

      alert("Hi");

       

      I have tried passing the file path to the doScript and get the same error.

       

      Any ideas what I am doing wrong?

       

      Cheers

       

      Roy