Adding and removing data to/from iCal
Question: I need to add/remove calendar data to/from iCal.

I google and found that I can uses [python
library](http://mashupguide.net/1.0/html/ch15s04.xhtml) to create the ics
file. With this, I can come up with applescript to run iCal to import the
generated ics file to add calendar info to iCal, but for deleting calendar
info, I don't know exactly what to do.

  * Q1 : How to delete calendar data in iCal with applescript or python?
  * Q2 : What would be other way to add calendar data in iCal?


Answer: To delete the an event within iCal you need to be able to identify it. This
can be done via the event's uid property or by some other identifying piece of
information. Here's a quick example:

    
    
    tell application "iCal"
        tell calendar "Chuck"
            set evt to make new event at end with properties ¬
                {description:"description", summary:"Summary", start date:get current date}
            set evtID to uid of evt
            set delEvt to every event whose summary is "Summary"
            delete delEvt
        end tell
    end tell
    

You can find a list of the properties that are available for an event by
taking a look at iCal's dictionary (File>Open Dictionary in Script Editor).

