How to get a date on different pages?
Hey everyone, I am working on a daily planner for the office and have a script that automatically generates the dates but I don´t know how to get each of the dates on a different page. I'd really appreciate if anyone could help me get each date generated by the script on teh following page of my 365 page document. The scrip is:
var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
var length = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
var days = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];
count = 0;
day = 0;
month = 0;
weekday = 5;
str = "";
while (count < 365)
{
count++;
str += days[weekday]+", "+(day+1)+" "+months[month]+"\r";
day++;
if (day >= length[month])
{
day = 0;
month++;
if (month > 11)
month = 0;
}
weekday = (weekday+1) % 7;
}
app.selection[0].contents = str;
Tanks!