Re: Insert today's date?
Re: Insert today's date?
- Subject: Re: Insert today's date?
- From: "Christopher C. Stone" <email@hidden>
- Date: Mon, 5 Mar 2001 15:00:21 -0600
At 03/05/2001 12:25 -0500, George Oliveira wrought:
>
Can't find a command for AppleScript to create a new folder and name the
>
folder with the current date in MM/DD/YY format.
This method doesn't require any osaxen.
---------------------------------------------------------------------------
on shortDate() -- adpated from Emmanuel Levy
set fullMonth to 2629728 -- 730.48 * 60 * 60
set halfMonth to fullMonth div 2 -- 1314864
set currDate to (current date)
copy currDate to janDate
set the month of janDate to January
set monthNum to (1 + (currDate - janDate + halfMonth) div fullMonth)
set mo to text -2 thru -1 of (("0" & monthNum) as string)
set da to text -2 thru -1 of ("0" & (day of currDate as string))
set yr to text -1 thru -2 of (year of currDate as string)
return (mo & "." & da & "." & yr) as string
end shortDate
tell application "Finder"
make new folder at desktop with properties {name:(my shortDate())}
end tell
---------------------------------------------------------------------------
--
Best Regards,
Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden