Hi,
Notice that there is a calendar ready to use, so your string builder could be simpler and more flexible:
var mDoc = app.activeDocument, mGBounds = [0,0,50,150], mYear=2013, mMonth = 0, mDay, currDate, currString;
mDoc.zeroPoint = [0,0];
with(mDoc.viewPreferences){ horizontalMeasurementUnits=MeasurementUnits.points; verticalMeasurementUnits=MeasurementUnits.points; rulerOrigin=RulerOrigin.pageOrigin; } // to prepare date string and place it on pagefor (mDay = 1; mDay < 366; mDay ++) { currDate = new Date(mYear,mMonth,mDay).toDateString(); currString = currDate.replace(/(\b\w+\b)\s(\b\w+\b)\s(0?)(\d+)\s(\b\w+\b)/, "$1, $4 $2"); mDoc.pages[mDay -1].textFrames.add({geometricBounds: mGBounds, contents: currString}) }
\s(0?) - is to eliminate leading zeros
"$1, $4 $2" - is to recompose a date string
Jarek