Syntax for make new event in iCal?
Syntax for make new event in iCal?
- Subject: Syntax for make new event in iCal?
- From: Jeff Porten <email@hidden>
- Date: Sun, 22 Sep 2002 13:53:10 -0400
I am trying to write a script to automatically create a new birthday in
iCal. Too many clicks to do it manually.
The following doesn't give an error message, but it doesn't create a
new event either. The result is +class ; 1 of application "iCal",
which looks awfully screwy to me. I've tried it with "set someVariable
to make new event..." and then individually setting the properties,
which *does* fail.
Suggestions? And BTW, this is the first RTF message I'm sending from
mail to prevent text wrapping in the script; if this shows up badly on
list, apologies.
Best,
Jeff Porten
set bDayNameRequest to display dialog ,
"Whose birthday is it?" default answer ,
"" buttons {"Cancel", "OK"} ,
default button "OK"
if button returned of bDayNameRequest is "OK" then
set bDayDateRequest to display dialog ,
"On what date? (mm/dd)" default answer ,
"" buttons {"Cancel", "OK"} ,
default button "OK"
if button returned of bDayDateRequest is "OK" then
set bDayDateText to text returned of bDayDateRequest & "/" & (year of
(current date) as string)
set bDayStartDate to date (bDayDateText)
set bDayEndDate to bDayStartDate + 1 * days
set bDaySummary to text returned of bDayNameRequest & "'s birthday"
set AppleScript's text item delimiters to "/"
set bDayMonth to the first text item of bDayDateText
set bDayRecur to "FREQ=YEARLY;INTERVAL=1;BYMONTH=" & bDayMonth
tell application "iCal"
set newBDay to make new event at calendar 1 with properties ,
{summary:bDaySummary, start date:bDayStartDate, end
date:bDayEndDate, recurrence:bDayRecur} ,
end tell
end if
end if
_______________________________________________
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.