title: Deleting an event from OSX Calendar with Applescript
body: <p>Deleting an event from OSX Calendar with Applescript apparently fails - the event is removed from a database but still appears in the Calendar app.</p>
  
  <p>Deleting the same event twice results in an error (event not found), so it is clear that the event, while still being visible in the app, is actually removed.</p>
  
  <p>Example with a counting of the events so that one can see that it is indeed deleted even if it still appears in the app :</p>
  
  <pre><code>tell application "Calendar"
      tell calendar "Personnel"
          set myEventUID to uid of (make new event at end with properties {summary:"Name of my event", allday event:"true"})
          count events
          delete event id myEventUID
          count events
      end tell
  end tell
  </code></pre>
  
  <p>The expected result is that an event is created in the Calendar app then deleted.
  The actual result (in OS X Mojave 10.14.4, probably other versions as well) is that the event is created but not "fully" deleted : it still appears in Calendar app, even if you close and re-open the app or reload the calendars.
  In Script Editor, the two counts of events included in this code sample are consistent : the second reports one even less, suggesting that it is indeed deleted (while you still see it in Calendar).</p>