• 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: Set Current date to new folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set Current date to new folder


  • Subject: Re: Set Current date to new folder
  • From: Guy Algot <email@hidden>
  • Date: Mon, 15 Jan 2001 00:52:29 -0700

On 1/14/01 9:34 PM, Joe Calabria sent:

>I want to create a new folder and name it the current date in the following
>format: 1/15/01
>
>I need to fill in the ???????:

set folderName to cleanUpDate(current date)

tell application "Finder"
activate
try
make new folder at desktop with properties {name:folderName}
on error
-- whoops! folder already exists
beep
end try
end tell

on cleanUpDate(vDate)
set vMonthNames to {"January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December"}
set vDateWords to words of (vDate as string)
repeat with i from 1 to 12
if (item 2 of vDateWords = item i of vMonthNames) then
set vMonth to i
exit repeat
end if
end repeat
set vDay to item 3 of vDateWords
set vYear to item 4 of vDateWords
return (vMonth & "/" & vDay & "/" & vYear) as string
end cleanUpDate

Later,
Guy


*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Guy Algot, Graphic Dimensions Consulting (403) 861-9882
email@hidden Calgary, Alberta
"The higher, the fewer!" Mac consulting/4D development
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
'Remember that as a teenager you are in the last stage of your
life when you will be happy to hear that the phone is for you'
-- Fran Lebowitz


  • Prev by Date: Re: Set Current date to new folder
  • Next by Date: re: Telling FilemakerPro to open a network
  • Previous by thread: Re: Set Current date to new folder
  • Next by thread: Re: applescript-users digest, Vol 2 #222 - 16 msgs
  • Index(es):
    • Date
    • Thread