Monday, November 08, 2010 at 12:02 AM.


on insertBoilerplateInOutline (itemName) {
		<<11/10/01; 7:17:36 PM by JES
			<<Set the outline's display to false while making changes, and restore it afterwards.
		<<9/5/00; 6:02:24 PM by PBS
			<<Insert boilerplate into the frontmost outline.
	local (adrBoilerplate = @user.bookmarksMenu.boilerplate.[itemName]);
	if not defined (adrBoilerplate^) {
		scriptError ("Can't insert \"" + itemName + "\" because the boilerplate outline can't be found.")};
	local (oldDisplay = op.getDisplay ());
	op.setDisplay (false);
	if op.getLineText () == "" {
		if op.getRefcon () == 0 {
			op.insertOutline (adrBoilerplate, up);
			op.deleteLine ()}}
	else {
		op.insertOutline (adrBoilerplate, down)};
	op.setDisplay (oldDisplay);
	return (true)}

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.