19 Replies Latest reply on Aug 1, 2013 2:17 PM by try67

    RaiseError when doing a saveAs

    thagio43

      Everything seemed to work fine in XP with Adobe 9 but now with Windows 7 things are breaking.

       

      The button script is:

      var filePath = "/C/";

      var newFileName = "yo.pdf";

      app.alert("hi");

      myTrustFunct(this,filePath+newFileName);

       

      and the script in C:\Program Files (x86)\Adobe\Reader 9.0\Reader\Javascripts is:

       

      // folder level JavaScript to allow access to the identity object properties

      trustedIdentity = app.trustedFunction( function (sProperty)

      {

      var iProperty = "";

      app.beginPriv();

      iProperty = identity[sProperty];

      app.endPriv();

      return iProperty;

      });

       

      // folder level JavaScript to allow Save As population of file name

      mySaveAs = app.trustPropagatorFunction(function(myForm, path)

      {

           app.beginPriv();

           //var myForm = event.target;

      path="/"+path;

             var rtn = myForm.saveAs(path);

       

           app.endPriv();

      return rtn;

        });

       

      myTrustFunct = app.trustedFunction(function(myForm, path)

      {

           app.beginPriv();

           var vPath = path;

           console.println("vPath: " + vPath);

           var retn = mySaveAs(this, vPath);

           app.endPriv();

             return retn;

      });

       

       

      console.println("SaveAsName has run 0:25");

       

       

      Getting:

      SaveAsName has run 0:25

      vPath: /C/yo.pdf

       

       

      RaiseError: The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder.

      Doc.saveAs:21:Field Button1:Mouse Up

      ===> The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder.

       

      ------------------------------------------------------------------------------------------ -------------------------------------

      I get the same results if I save to C: or a network drive. Any suggestions? Thanks so much!!