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

on getBookmarkLogic (adr, adrLogic, adrTitle) {
	<<This script handles bookmarking file-based outlineWindows.
	local (atts);
	if window.attributes.getAll (@atts, adr) {
		local (title);
		if defined (atts.title) {
			title = atts.title}
		else { //use the window title instead of the title attribute
			title = window.getTitle (adr)};
		local (f);
		if defined (atts.f) {
			f = atts.f}
		else { //can't create a bookmark for unsaved files
			dialog.alert ("Can't create a bookmark for this file because it has never been saved.");
			return (false)};
		adrTitle^ = title;
		if system.environment.isWindows { //escape backslashes on Windows
			f = string.replaceAll (f, "\\", "\\\\")};
		adrLogic^ = " (\"" + string.replaceAll (f, "\"", "\\\"") + "\")";
		return (true)};
	return (false)}

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.