1 Reply Latest reply on Mar 1, 2016 7:48 AM by gmailJerald

    How to add the current date and time to the filename when saving the file in Adobe Pro XI?

    gmailJerald

      I would like to get the date and time to append to the filename of a pdf file when it is saved.

      Here is the function used for saving the file when a button is clicked:

      mySaveAs = app.trustPropagatorFunction(function(doc,path)
      {
      app.beginPriv();
      doc.saveAs(path);
      app.endPriv();
      })
      
      
      myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
      {
      // Privileged and/or non-privileged code above
      app.beginPriv();
      mySaveAs(doc,path);
      app.endPriv();
      // Privileged and/or non-privileged code below
      });
      

      Here is the code for the button (mouseup):

      myTrustedSpecialTaskFunc(this, "/F/signedcontracts/signeddoc.pdf");
      

       

      I would like to have the filename in the following format:

      /F/signedcontracts/signeddocyyyymmddhhmmss.pdf

      I have read through and tried several examples, but I'm still unable to get it to work properly.