views:

47

answers:

2

I'm attempting to follow this tutorial 'Demystifying Mail.app Plugins on Leopard' to build a Mail.app plugin. Instead of using PyObjC I'm trying to use MacRuby. I've got MacRuby 0.6 loaded up and I've gotten to this step in the tutorial (PyObjC code):

 MVMailBundle = objc.lookUpClass('MVMailBundle')

I've search the web a bit but can't seem to find any information about loading the private framework 'MVMailBundle' in MacRuby. Any ideas?

Thanks in advance - AYAL

+1  A: 

I think the idea is that this plugin will be loaded into Mail.app, which will already have loaded the private framework in question. So we just want to look up a class at runtime (which is what that Python snippet is doing — not loading a framework). The way to do this in MacRuby is MVMailBundle = NSClassFromString 'MVMailBundle'.

(You will need to include framework 'Cocoa' in order to get the NSClassFromString method, but I assume you'll have already done this.)

Chuck
Great! I think this starts me on my way. Thank you very much!
Ayal
A: 

MacRuby uses garbage collection and Mail doesn't. You can't load a GC bundle into a non-GC app. So this is a dead-end.

kch