Re: iCal organization with dates & events & lists....
Re: iCal organization with dates & events & lists....
- Subject: Re: iCal organization with dates & events & lists....
- From: Adam Wuellner <email@hidden>
- Date: Thu, 17 Mar 2005 16:47:52 -0600
Please note that it's perfectly acceptable to condense the problem to
the smallest chunk of code that reproduces the problem... :)
On Thu, 17 Mar 2005 14:17:17 -0800 (PST), Patrick Collins
<email@hidden> wrote:
> this has my application of your suggestion........ I get an ical error:
> item 1 of event_list of <script> doesn't understand the date_time message.
>
> -patrick
>
[snip]
> repeat with event_cur in my event_list
> tell event_cur
> set cal_date to (start date as string)
Wait a second... iCal will return 'start date' as a date, so why not just...
set cal_date to start date
set editdate to short date string of cal_date & " " & time string of cal_date
...and dispense with the next three lines and the date_time handler altogether.
But to explain why you got the error:
> set datetime_string to my date_time(cal_date)
Ok... the above line *should* set the variable 'datetime_string' to a
string in the format
MM/DD/YY HH:MM:SS AM/PM
(depending on your International prefs...)
> date_time(datetime_string)
This line is unnecessary. ^^ It is also what was throwing the error.
If you are calling your own handlers within a tell block, you need to
call 'my handler()', like in the previous line (note the word 'my'
just before the name of the handler 'date_time'). Otherwise, it
assumes the handler is provided by the object of the tell block (an
iCal object in this case), which it isn't, which causes an error.
However, the handler returns a string, so calling it like you do here
does no good unless you assign the result of the call to a variable.
> set editdate to datetiem_string
This line contains a typo. ^^ It's also unnecessary.
> set the end of event_choose to editdate & " " & summary
> set the end of summary_list to summary
> set the end of startdate_list to start date
> set the end of enddate_list to end date
> set the end of location_list to location
> set the end of url_list to url
> set the end of description_list to description
> set the end of status_list to status
> set the end of attendee_list to {display name of attendees}
> set the end of uid_list to uid
> end tell
> end repeat
[snip]
If time permits, and no one beats me to it, I'll try to get back to
you with more general comments on your script.
- Adam
_______________________________________________
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