5 Replies Latest reply on Oct 8, 2010 7:18 AM by Marijan Tompa [tomaxxi]

    app.open (file(using variables)); Problem

    jmituzas

      I am attempting to create variables for a few things and getting error.

      Here is what I have that I am getting an error on:

       

      main();

       

      function main(){

          mySetup();

          mySnippet();

          myTeardown();

      }

       

      //<setup>

      function mySetup(){

       

      group = "RXC03593";

      brand = "Generic"

      date = "10082010";

       

      // DO NOT EDIT BELOW THIS LINE !!!

       

      dirPath =  "P:" + "/RxCut/In Design Implementation/" + group  + "/";

      app.open(File(dirPath + brand + "~StandardCard~" + group  + ".indd"));

       

          //If the master spread contains more than a single

          //page, delete the additional pages.

           }

       

       

       

      Here is the error:

       

       

      JavaScript Error!

       

      Error Number: 29446

      Error String: Either the file does not exsist, you do not have permission, or the file may ber in use by another application

       

      File: shows file path

      Line 33

      Source: app.open(File(dirPath + brand + "~StandardCard~" + group + ".indd".));

       

       

      Of course that file does not exsist! AHow can I use a variable there?

       

      I already guessed that it is a syntax error. Please help me get the right syntax to achieve what I am trying to do.

      Thanks in advance,

      Best regards,

      Joe