Stumped: saving data

I’ve thrown together an app that I’m fairly happy with except that I can’t figure out exactly how to save the data in an outline view.

As best I can tell, I need to use the data representation and load data representation handlers. I’ve adapted the handlers from the Task List example to my script, but I don’t seem able to trigger them because the “Save” and “Save as…” menu items are grayed out in my app’s menu. I assume I need to enable some kind of connection, but I can’t figure out what it is.

Any help is much appreciated. Thanks.