In my Config.js file (Location: C:\Program Files\adobe\Reader 9.0\Reader\Javascripts)
//DateTime function
function myDateString()
{
app.beginPriv();
todayDate = new Date();
myYear = todayDate.getFullYear(); //return the four digit year
myMonth = todayDate.getMonth(); //return the month
myDate = todayDate.getDate(); //return the day of the month
myHour = todayDate.getHours(); //return the hours
myMin = todayDate.getMinutes(); //return the minutes
mySec = todayDate.getSeconds(); //return the seconds
myNewDate = myYear.toString() + myMonth.toString() + myDate.toString() + "_" + myHour + myMin + mySec;
return myNewDate;
app.endPriv();
}
// SaveAs Function
function saveDoc()
{
app.beginPriv();
var myDoc = app.newDoc();
var myPath = app.getPath("user", "documents") + "/WebRequestFiles/" + myDateString() + ".pdf"
myDoc.saveAs(myPath);
myDoc.closeDoc();
app.endPriv();
}
In MySaveAsForm.pdf (click event of "regular" button):
// SaveAs Function
var SaveRequest = app.trustedFunction(saveDoc());
@echo off
set newfile=%1%date:~6,4%%date:~3,2%%date:~0,2%
echo %1 %newfile%