Just figured out how to create a new To Do, which shows up in both Mail and iCal, using AppleScriptObjC rather than via iCal’s applescripting. This is nice because iCal doesn’t need to be open to do it.
Thought I’d post the code in case anyone else is interested:
Copy the properties to the beginning of your script.
using the handler is as simple as this
Where “Remember The Milk” is the to do
3 (as integer) is the priority of the to do, on a scale of 1 - 4, where 1 is no priority and 4 is highest priority.
“Thursday” is the date, which is parsed thru NSDate’s natural language class, meaning the following all work:
“Thursday”, “Tomorrow”, “11/12”, “12/09/09”, and more.
Lastly, in the newTodo handler, you need to change useCal to the name of the calendar you want the To Do listed in, as a string
UPDATE-- forgot two things:
in XCode, right-click on Linked Frameworks and choose add existing framework, then scroll to find CalendarStore.framework and choose that.