Pensieri di un lunatico minore

28 January 2007 Ruby

Ruby, OSA and MindJet’s MindManager

I have recently started using MindJet’s MindManager to do a lot of exploration of ideas. This has been very useful for me to get a lot of interesting things down. Previously, I had used OmniOutliner for that, but in some ways, that was a bit difficult to visualize a lot of the relationships.

One area I’ve been exploring is using MindManager to develop the skeleton of a document, and as I’m working on that, I decided that I’d try to write a little script to take the structure in MindManager and turn it into a LaTeX document. Since MindManager supports AppleScript I started to look at writing some AppleScript to do it, but quickly remembered that I absolutely hate writing AppleScript. Instead, I thought about the whole Open Scripting Architecture that Apple provides and a bulb went off.

A while back, I remembered reading about rubyosa, which provides a bridge between the underlying object model of OSA and Ruby. This is a substantially nicer alternative to AppleScript, and actually makes for a nice way to develop code. For example, the following snippet will go through all the Topics in the frontmost mind map and display them. It’s trivial, but, a start:

require 'rbosa'
mm = OSA.app('MindJet MindManager')
front_document = mm.documents.first
front.document.central_topic.subtopics.each { |topic| 
  puts topic.title }

Very simple, but demonstrates how quickly you can get information. Make sure you run the rdoc-osa script to generate documentation for the dictionary. This works pretty well, and I’ll post the script as soon as I finish. One unfortunate thing, which is mentioned in the support forums, is that the notes area of the map—text attached to each topic—is not available via OSA yet. This sucks, because otherwise it would be a great way to start putting thoughts together even better.

This entry was posted at 11:58 pm on 28 January 2007 and is filed under Ruby. You can follow any responses to this entry through the post-specific RSS 2.0 feed.

Chris,
As the evangelist for the Mindjet Soution Platform, I commend you on your synergistic perspective. I am looking for independent voices on the Mindjet Labs (http://mindjetlabs.com) who can talk intelligently about how they are extending MindManager. The problem is that I am missing a Mac-centric voice. If you are interested in contributing, our growing community is hungry for real-world experience of extending MindManger on the Mac. Our developers know very well about the lack of notes support and your comment is heard.

Michael S. Scherotter
Solution Platform Product Manager
Mindjet Corporation

Combining Ruby OSA and MindManager…

I just read a great post by someone who is combining Ruby , Open Scripting Architecture (OSA), and MindManager…

Hey!

Could you tell me exactly what’s not supported yet (if possible with a code snippet)? I didn’t see anything relevant in our bug tracker / mailing list.

Thanks in advance,
Laurent (RubyOSA’s author)

Michael – Sure, I actually got some of my information off the forums there, and do have an account. I’ll try and speak up about the Mac “issues” wherever possible. It’s nice to see the product is not a straight port over, and instead is a Mac application of the first order.

Laurent – It’s not RubyOSA that’s at fault here. It’s that MindManager’s dictionary is missing pieces that I’d like to have access to. They’re simply not exposed yet. RubyOSA rocks.

Chris,
Would you be interested in contributing as a Mindjet Labs blogger
(http://mindjetlabs.com/cs/blogs/default.aspx). I will setup a blog for you (you pick the name) and you can write whatever you want (within reason) about working with MindManager and AppleScript. If this is something that you would be interested in, send me an email.
Thanks,
Michael

It only seems right that you might use Ruby to drive MindManager. The build scripts that we use to build MindManager on the Macintosh are actually Ruby scripts. Those scripts use command line tools for XCode, (and some AppleScript… through osascript) to drive the various utilities that put the application together.

Scott Thompson

Scott—Interesting, and very nifty. I have to say that for me, at least, driving OSA through Ruby is 1000x nicer than Applescript, which always seems to make my head hurt in it’s near consistent inconsistency. Once I can get access to the Notes fields of Topics, I can actually start using it as a productive drafting tool for documents.

You can leave a response, or trackback from your own site.