[MacRuby-devel] Using scripting bridge to create new objects within a Cocoa App.

Kevin Poorman kjp at brightleafsoftware.com
Sun Oct 28 09:30:28 PDT 2012


Morning,


I've been trying to use MacRuby to drive an integration between a popular webservice and the stock Reminders.app. I'm attempting this through the scripting bridge and am running into difficulty getting the scripting bridge Create new objects within reminders.app, or notes.app, or any other app i've tried. 

Examplar code:

n = SBApplication.applicationWithBundleIdentifier("com.apple.notes")
new_note = NotesApplication::NotesNote.new
	#NoMethodError: undefined method `==' for "#<SBProxyByClass:0x403a45ea0>":String

Ok, so perhaps I need to give it some options. lets try name:

new_note = NotesApplication::NotesNote.new name = "foo"
ArgumentError: wrong number of arguments (1 for 0)
	(irb):138:in `<main>'

harumph. 

Ok well lets fire up the dictionary - it says the method is "make"
n.methods(true,true).grep /make/i
	# []
hmm. ok
NotesApplication.methods(true,true).grep /make/i
	# []

I can't find the make method on any object and new is throwing an odd error that I can't seem to inspect. 

Help?


More information about the MacRuby-devel mailing list