Re: Syntax for make new event in iCal?
Re: Syntax for make new event in iCal?
- Subject: Re: Syntax for make new event in iCal?
- From: Jim Burton <email@hidden>
- Date: Sun, 22 Sep 2002 18:50:48 -0600
On Sunday, September 22, 2002, at 11:53 AM, Jeff Porten wrote:
>
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.
>
The following could use some comments and streamlining, but it works:
property iCalendars : {}
tell application "iCal"
set x to calendars
repeat with i from 1 to count of x
copy title of item i of x to end of iCalendars
end repeat
end tell
set theSDay to "14"
set theSMon to "September"
set theSYear to "2002"
set theSTime to "1:00 PM"
set theEDay to "14"
set theEMon to "September"
set theEYear to "2002"
set theETime to "2:00 PM"
set theCalName to "Home"
set i to 1
repeat with anitem in iCalendars
if item i of iCalendars is equal to theCalName then
set theNum to i
end if
set i to i + 1
end repeat
set currentCal to item theNum of x
set theSummary to "This is a summary"
set theDescrip to "This is a description"
set tempDate to theSDay & " " & theSMon & " " & theSYear & " " &
theSTime as string
set theDate to date tempDate
set tempDate to theEDay & " " & theEMon & " " & theEYear & " " &
theETime as string
set otherDate to date tempDate
-- set recur to "weekly" as string
tell application "iCal"
make event at end of events of currentCal with properties {start
date:theDate, end date:otherDate, summary:theSummary,
description:theDescrip, status:confirmed}
end tell
_______________________________________________
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.