On 2007-12-05, at 00:25, Ron wrote:
This is my standard date and time script I use when generating reports with beginning and end dates.
Hi Ron,
Here's a way to achieve what I think is the goal of your script in a more compact form. The key thing I'm illustrating is the use of the special input strings "0" and "1" to get relative dates out of AppleScript easily.
on FormatDateWithDelimiter(thePrefix, theDate, theDelimiter, theSuffix)
set d to theDelimiter
return thePrefix & ((month of theDate) as number) & d & day of theDate & d & year of theDate & theSuffix
end FormatDateWithDelimiter
set rs_date to ((date (1 as text)) - 1 * days)
set re_date to date (0 as text)
set ctime to time of (current date)
set r_time to FormatDateWithDelimiter("Report Time: ", re_date, "-", "_" & ctime)
set r_end to FormatDateWithDelimiter("Report End: ", re_date, "/", "")
set r_beg to FormatDateWithDelimiter("Report Start: ", rs_date, "/", "")
r_time & return & r_beg & return & r_end
Philip Aker