Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tfindlay

macrumors newbie
Original poster
May 15, 2008
1
0
The following works to create a new event for today but what do I use in place of "set theDate to current date" if I want to use a specific start date (such as May 27, 2008) rather than the current date?

tell application "iCal"
tell calendar "My Calendar"
set theDate to current date
make new event at end with properties {description:"Event Description",
summary:"Event Name", location:"Event Location", start date:theDate,
allday event:true}
end tell
end tell
 
You would do this…

Code:
set theDate to date "5/27/08"

When you compile the script the though it will expand theDate to the full format - date "Tuesday, May 27, 2008 12:00:00 AM"

If you don't want the values to expand until run time you would do it like this…

Code:
set theDate to "5/27/08"
set theDate to date theDate
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.