Re: Create a folder with today's date as the folder name
Re: Create a folder with today's date as the folder name
- Subject: Re: Create a folder with today's date as the folder name
- From: Gnarlodious <email@hidden>
- Date: Sat, 09 Feb 2002 14:18:14 -0700
Entity email@hidden spoke thus:
>
I am able to script to create a new folder but do not know how to tell it to
>
insert today's date !!
We were just discussing this to death, everyone is tired of it.
Here is what I use, it changes the name of a folder dropped on it to today's
date:
on open dropped
set theDay to day of (current date)
if theDay < 10 then set theDay to "0" & theDay
set theMonth to my GetMonthNumber()
if theMonth < 10 then set theMonth to "0" & theMonth
set theYear to year of (current date)
set theFolderName to "" & theDay & "-" & theMonth & "-" & theYear
try
tell application "Finder"
set name of folder (dropped as alias) to theFolderName
end tell
end try
end open
on GetMonthNumber()
set theDate to (current date)
copy theDate to b
set the month of b to January
return 1 + (theDate - b + 1314864) div 2629728
end GetMonthNumber
This is a "droplet", save the script as "application". It will not run in
your editor window. To edit the script drop it on your Editor's icon.
That should get you going.
Rachel
http://www.gnarlodious.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.