[Pythonmac-SIG] appscript with todos in iCal seams very slow

Marcin Komorowski marcink at ieee.org
Tue Aug 8 02:49:08 CEST 2006


Thanks Has, this definitely did the trick.

I guess when I get to updating individual values in selected todos  
records, I will have to use a relatively slow request-per-update  
method.  Is there a trick to update a field of a todo with a given  
uid in a single request?

Thanks,
Marcin

On 6-Aug-06, at 7:05 PM, has wrote:

> Marcin Komorowski wrote:
>
>> I am trying to generate a python internal structure (a dictionary of
>> dictionaries) with a copy of all todo data from iCal.  I got it to
>> work using the following code:
>> [...]
>> The problem is that this appears to execute painstakingly slowly.
>
> Apple event IPC is fairly expensive; asking applications to resolve
> lots of object model 'references' (i.e. queries) especially so.
> Sending a few complex queries is usually much, much quicker than
> sending lots of simple ones, e.g. the following will pull all
> property values from all todos in a single go:
>
>      todos = appCal.calendars.filter(its.name !=  
> '').todos.properties()
>
> You can then rearrange this data in Python to suit your needs.
>
> There's more information in the appscript manual: chapters 2 and 3
> discuss how Apple events and the Apple Event Object Model work;
> chapter 12 discusses various optimisation techniques for getting good
> performance out of the system.
>
> HTH
>
> has
> -- 
> http://freespace.virgin.net/hamish.sanderson/
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig



More information about the Pythonmac-SIG mailing list