Wednesday, September 17, 2008

Freemind on the Mac, and converting to OPML

I wrote last year about a great open source brainstorming and mind mapping tool, Freemind 0.8.0 - Java Mind Map software, but I was concerned that the program hadn’t seen a significant update in several years. Well, it’s just been updated this year to 0.8.1, and you can download it from SourceForge.net: FreeMind. Version 0.9.0 is still an unstable beta, and not readily available

As a Mac guy, I’m interested in Importing/exporting to FreeMind from my favorite outliner program, OmniOutliner. I started by downloading version 0.8.1 from 2008-01-26, as a Mac OS X .dmg file, which is the most recent version of the program available as a DMG file.

Next, it’s time to run XSLT transformations on the Mac. Some XSLT resources:

The Tao of Mac - Resources led me to XSLT Tools Scripting Addition. I downloaded their XSLT Tools. I also looked at AquaXSL, from Scandalous Software - Mac XML Tools by Todd Ditchendorf, which is not suitable for bulk transformations, but demonstrated that I could take a FreeMind document, convert it to OPML, and open it in OmniOutliner.

I can script this using Automator: Transforming a Shell Script into an Automator Action using the xsltproc tool, or I can just do it from the command line, like this:

xsltproc --verbose --output output-file.opml /Applications/FreeMind/accessories/mm2opml.xsl inputfile.xml

Note that xsltproc doesn’t care what the file names or extensions are, either.

Now I’m getting greedy: I’d like to use these tools to connect FreeMind to OmniFocus. Answers to the question Export to omni outliner? led me to some AppleScripts that might help: Omnifocus to Omnioutliner Pro exporter and Create an OPML version of the Omnifocus database, or Curt Clifton | Software offer some export scripts for OmniFocus.

These tools are useful for anyone who uses mind mapping software that supports OPML, including NovaMind Pro Mind Mapping Software.

6 comments:

Neil Johnson said...

I was also able to run this in reverse, to import an OPML file from OmniOutliner into Freemind. Here's a sample command:

xsltproc --verbose --output new-mindmap-file.mm /Applications/FreeMind/accessories/opml2mm.xsl exported.opml

Brian Fox said...

Hi, I'm a bit of a novice, but would love to be able to convert between omnioutliner and freemind. When I tried following the above example using the following command (omnioutliner->freemind):

xsltproc --verbose --output new-mindmap-file.mm /Applications/FreeMind/accessories/opml2mm.xsl exported.opml

I got the following error:

xsltproc --verbose --output new-mindmap-file.mm /Applications/FreeMind/accessories/opml2mm.xsl New Plan.opml
warning: failed to load external entity "/Applications/FreeMind/accessories/opml2mm.xsl"

any thoughts? Thanks!
brianlyndonfox@gmail.com

Neil Johnson said...

Brian,

A couple of solutions. First, you need to locate the "opml2mm.xsl" file on your hard drive -- I recommend the always handy Spotlight. Just update the path name in the command listed with the full path to the file on your hard drive.

Second, if you've located this file, you could also use the Export feature in Freemind itself:

File > Export > Using XSLT... to open the ExportDialog box. There, use the browse button to choose the XSL file you just located, and also provide a name and location for your export file. Finally, click [Export]. This runs the same transformation as the command line above.

As you can see, you need to know where the XSL file is with either approach. You can always download Freemind again, as these files are part of the distribution.

Hope that helps!

Brian Fox said...

Neil, Thanks so much for your help. I've made some progress finding the opml2mm.xsl file and using the export function you described. However, the omnioutliner file that gets created is consistently empty. I have a feeling something is not right with how I've installed XSLT tools. I followed instructions:

Please follow these steps to install the XSLT Tools scripting addition on Mac OS X systems:

1. Create a folder named ScriptingAdditions in your user account's Library folder (known as ~/Library) if one does not already exist.
2. Copy the XSLT Tools.osax into the ~/Library/ScriptingAdditions folder.

Is this the right place for the installation?:
/Users/brianfox/Library/ScriptingAdditions/XSLT Tools.osax

Once again thanks for your help. Is there any other reason you can think why I could be having this problem. When I try using the command line I get the following error message:

warning: failed to load external entity "/Applications/FreeMind/accessories/mm2opml.xsl"
cannot parse /Applications/FreeMind/accessories/mm2opml.xsl

I appreciate your help. -Brian

Neil Johnson said...

Brian,

First, it looks like you put the XSLT Tools.osax file in the right place. Second, it looks like the mm2opml.xsl file on your computer is damaged or corrupt. I'd suggest downloading the latest Freemind and grabbing a fresh copy of mm2opml.xsl from the Freemind download.

Hope that helps!

Brian Fox said...

HAHAHA! It all works! About three stupid mistakes on my part that I figured out at a rate of 1/hr. Like I said I'm a bit of a novice. But, thanks again for your help! I hope I grew some neurons in the process. -b