9 Replies Latest reply on Apr 28, 2010 12:58 PM by try67

    Browse a pdf file and open it?

    Erkki Pennanen Level 1

      I have done the following, but something is wrong. Hoping to somebody could help me, thanks!

       

      1. Config Javacript as:

       

      myTrustedBrowseForDoc = app.trustedFunction( function ( oArgs )
      {
      app.beginPriv();
      var myTrustedRetn = app.browseForDoc( oArgs );
      app.endPriv();
      return myTrustedRetn;
      });

       


      myTrustedOpenDoc = app.trustedFunction( function ( oArgs )
      {
      app.beginPriv();
      var myTrustedRetn = app.openDoc( oArgs );
      app.endPriv();
      return myTrustedRetn;
      });

       

      2. The actual script in a button:

       

      try {
      console.show()
      var oRetn = myTrustedBrowseForDoc({bOpen: true});
      var oRetn = myTrustedOpenDoc({cPath: oRetn });  // Here should be the found address
      console.println("Is the file opened?");
      } catch(e) {
      console.println("Error!");
      }