• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Insert today's date?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Insert today's date? (From: George Oliveira <email@hidden>)

  • Prev by Date: Re: [ANNOUNCEMENT] Dialog Studio
  • Next by Date: Re: Get Cell Data FileMaker Pro
  • Previous by thread: Re: Insert today's date?
  • Next by thread: Re: Insert today's date?
  • Index(es):
    • Date
    • Thread