views:

98

answers:

3

Hey guys,

quick background: I'm a .NET developer, mainly Web, but with some experience in old skool VBA, WinForms, some WPF, and a lot of Services.

I've now bought a new Mac (Snow Leopard), and loving it, and have my first need for a custom "app".

I don't need explicit instructions on how to build this app, but I need a starting point, as I know pretty much nothing about developing for OSX. I'd really like to write this app, even if a tool exists, as a learning exercise.

APP:

  1. The App first needs to take "Tasks" from an iCal calendar.
  2. Then, it needs to process the "Task" objects, and turn them into iCal "Events", "Events" as in a calendar event, like "go to the dentist".
  3. Finally the app needs to insert these "events" into another iCal calendar.

Ok, pretty simple. Obviously I don't need help with Step 2, that's just business logic. Once I have some objects in memory, I can play around with them and create new objects, or ics files, or whatever.

But I do need help with Steps 1, and 3, and in general how the app would exist.

For example, what are the options? Would the App be a "service"? If so, how? Ideally the App would only perform the actions when "Tasks" change in the first calendar. Is this possible?

Finally, how do I communicate programatically with iCal, is what I want possible?

Ideally I'd like to be able to pass this app to someone else, without much need for config, apart from specifying if it's allowed to run or not, and the names of the two calendars.

Ideally, again, it would kinda exists like the app "Growl", which just runs, works, and has a "Settings" form in the global "Settings" for OSX.

Cool, thanks for any help!

A: 

Apple provides the Automator. http://www.apple.com/downloads/macosx/automator/

Did you read about that?

Does it do what you want?

S.Lott
thanks s.lott, but I'd quite like to write an "app" or "automator" myself as a learning exercise. would just like some specific info on the options available to me as an OSX developer.
andy
Automator is an optional available to you as an OSX Developer. What more do you need? Did you look at it?
S.Lott
+2  A: 

This is only a partial answer, but to get something to run like a service on Windows, use launchd. Build your app as a console program.

If you're familiar with C#, consider using Mono and MonoDevelop. MonoDevelop is to Visual Studio as OpenOffice is to MSOffice. It's actually quite a wonderful IDE and free. It feels almost the same as Visual Studio, and will even open and use Visual Studio project/solution files! The downside is a dependency that your customers will need, the Mono framework (currently 2.6.1.1). But it is available as a standard Mac dmg/installer. And Mac/Linux people are used to dependencies anyway.

Bob Denny
thanks bob. I'm actually playing around with MonoDevelop on the Mac and loving it. But ideally I'd really like to start using the OSX APIs.
andy
+3  A: 

The easiest way to communicate with iCal is to use its Apple Events scriptable interface. The most common way to do that is through AppleScript but there are a number of other options: I prefer the Python version of Appscript (it supports Ruby and Objective-C, as well).

However, any of those solutions require the iCal.app to be running. Apple thoughtfully provides the Calendar Store framework, an API to access iCal data directly. As with all Cocoa frameworks, this is for Objective-C but there are wrappers to it from other languages, for instance, PyObjC provides a Python wrapper for Calendar Store.

At a lower level, there are open-source libraries out there that deal with reading and writing iCalendar format files, which iCal knows how to import and export. See, for instance, vobject.

Ned Deily