Re: iCal and Applescript (beginner)
Re: iCal and Applescript (beginner)
- Subject: Re: iCal and Applescript (beginner)
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 02 Oct 2005 08:31:08 -0700
- Thread-topic: iCal and Applescript (beginner)
Title: Re: iCal and Applescript (beginner)
On 10/2/05 2:15 AM, "Jay Louvion" <email@hidden> wrote:
le 2/10/05 10:58, Bernard Bernu à email@hidden est réputé(e) avoir écrit :
> I succeeded to get events from calandars but for instance not to make new
> ones.
>
> I tried that :
> tell application "iCal"
> set thecal to first calendar whose title is "EnAcT-Val"
> set eventList to every event of thecal
> set new_event to make new event at thecal with properties {start date:date
> "lundi 3 octobre 2005 9:00:00", end date:date "lundi 3 octobre 2005 12:00:00",
> summary:"essai"}
> end tell
>
Try this to get started:
set rightcalendar to "Work"
set eventName to "Meeting"
set EventDescription to "At my place"
set EventStartDate to date "2.10.2005 10:30:00"
set EventEndDate to date "2.10.2005 11:30:00" --it compiles as “Dimanche, 2 octobre 2005”
tell application "iCal"
set targetCal to first calendar whose title is rightcalendar
make new event at the end of events of targetCal with properties ¬
{summary:eventName, description:EventDescription, start date:EventStartDate, end date:EventEndDate}
end tell
This seems to contradict recent semi-official assertions on this list that 1) making elements 'at the end of' or 'at the beginning of' is no longer (Tiger) required for Cocoa apps and 2) a follow-up assertion that this lack of such requirement "began in Panther". Assuming, that is, that Bernard is not in Jaguar (where next to nothing worked in iCal). Perhaps it is only true for apps that implement it properly? (I believe Address Book was the app referenced on that occasion.)
Well, it doesn't error, but it doesn't actually make an event, in OS 10.4.2. On a US system with US dates:
tell application "iCal"
make new event at calendar "Work" with properties {summary:"Test", start date:date "Sunday, October 2, 2005 9:00:00 AM", end date:date "Sunday, October 2, 2005 10:00:00 AM"}
end tell
--> «class » 1 of application "iCal"
(whatever that's supposed to mean), but no event appears in the calendar.
tell application "iCal"
make new event at end of events of calendar "Work" with properties {summary:"Test", start date:date "Sunday, October 2, 2005 9:00:00 AM", end date:date "Sunday, October 2, 2005 10:00:00 AM"}
end tell
--> event 45 of calendar 16 of application "iCal"
and an event duly appears in iCal.
So it's not true that "making elements 'at the end of' or 'at the beginning of' is no longer (Tiger) required for Cocoa apps " unless the Cocoa app actually implements this change. It's most definitely not true for iCal.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden